Recoil is the backward movement or “kick” of a gun when fired. Recoil is caused by the propellant (powder) gases pushing the projectile (bullet, slug, pellets ) through the bore and the jet effect of the gases themselves. The recoil momentum acquired by the gun equals the forward momentum of the projectile and exhaust gases.
Recoil adheres to Newton’s 3rd Law of Motion: To every action there is always opposed an equal reaction: or the mutual actions of two bodies upon each other are always equal, and directed to contrary parts.
Many devices are available for both rifles and pistols to help mitigate the recoil felt by the shooter (muzzle brakes, recoil absorbing stocks, recoil pads, and others).