A muzzle booster was first used on a Vickers machine gun of 1912. During World War II, it was used by the German MG-42 as well as the later MG-3 machine gun.
The basic example, as used on the Vickers machine gun consists of a flared cup attached to the end of the barrel. There is also an outer tube that surrounds the barrel as well. The outer tube is aligned very precisely so that it has an exit hole for the bullet to pass through after it emerges from the barrel. The outer tube also has other perforations to allow gases to escape.
When the bullet is first fired, it comes out of the barrel along with some burnt propellant gases. As it passes through the hole in the outer tube, it temporarily prevents gas from escaping out of the barrel. Therefore, the pressure in the outer tube rises and the gas moves backwards and pushes on the flared cup attached to the end of the barrel. This provides additional force to move the barrel backwards. The excess gas then escapes through some perforations on the outer tube. The animation below shows how this works (click on the image to view the animation).
Click on the image to view the animation.
Image licensed under Create Commons Attribution-Share Alike 2.5 Generic, 2.0 Generic and 1.0 Generic license
Created by user GraemeLeggett at en.wikipedia.org
Muzzle boosters are also used when attaching silencers (or, to give the correct name, "suppressors") to short recoil operated pistols (i.e.) most modern semi-automatic pistols. Since the barrel and bolt are the recoiling parts of a short recoil operation, adding a silencer to the barrel increases the barrel weight. The extra weight may interfere with the recoil operation since more force is now needed to push the barrel backwards fully. Using a muzzle booster provides the extra force to counteract the extra weight added. This muzzle booster is sometimes referred to as a Nielsen device.
The same idea is also used for some blank firing adapters (BFA). During ceremonial occasions and military demonstrations, users are provided with blank cartridges that only contain the propellant, but not the bullets. Blank cartridges have lesser power than normal cartridges that contain bullets. Therefore, firing a blank cartridge produces much less recoil force, which means that it may prevent a recoil operated action from working properly. By screwing on a special muzzle booster (the blank firing adapter) to the end of the barrel, the extra force required to cycle the action is generated.