The recoil when firing a gun is the backward momentum of the gun, which is equal to the forward momentum of the bullet or shell, due to the law of conservation of momentum. It has to be absorbed by for example the wrist, the shoulder or the carriage.
For handguns it has to be limited to avoid breaking one's wrist, see also cartridge (weaponry).
It should be noted that the impact to the target can be no greater than the impact of the recoil, due to the law of conservation of momentum. However, the smaller size of the bullet, compared to the gun-and-shooter system, allows significantly higher energy to be imparted to the bullet than to the shooter, giving guns their lethal effect. See physics of firearms for a more detailed discussion.
Hollywood depictions of firearm victims being thrown through plate-glass windows are inaccurate, as were this to be the case, the shooter would also be thrown backwards with equal force. Gunshot victims frequently do collapse when shot; however this is usually due to the effect of the energy of the bullet on their body systems, not the momentum of the bullet pushing them over.
(Note that the above does not apply if the victim is hit by heavy weapons fire such as aircraft cannon, where the momentum effects can be enormous; this is why these weapons need to be mounted on a weapons platform.)
A recoil system absorbs momentum, for example by the barrel moving backwards; cannons etc. without recoil system roll several meters backwards when fired.
In a soft-recoil system, a gun's barrel is moved forward prior to shooting. As the barrel is forced backwards by the recoil force, the energy is reduced by friction, resulting in less of an overall "kick". One of the early guns to use this was the French 65mm mle.1906; however, this method did not receive much attention until the 1970s.
Recoilless guns or recoilless rifles exhaust gas to the rear, balancing the recoil. They are used as light antitank weapons.