The total momentum 'p' of two balls remain conserved after they collide because the net external force acting on the system is .
The total momentum of a system always remain unchanged before and after the collision regardless of the external forces acting on the system.
For system on which no net external force acts, momentum is:
If no external forces acts on a system of particles then the momentum of the system remains conserved.
The total momentum of a gun-bullet system remains unchanged after the shot is fired(Assume that no external force is acting on the system).