it is based on newtons third law and momentum conservation in a closed system
for every action there is an equal and oppsite reaction
you could also consider the rifle gun system the momentum should be the same when no external force acts on it. sum of initial momenta = sum of final momenta
intially the rifle is at rest along with its bullet
once fired the bullet has a huge momentum forward which should bebalanced by the recoil momentum of the rifle
3/1000 kg * 300 m/sec = 2.4kg * velocity of rifle
velocity of rifle = .375 m/sec
hoep this is clear