"When the firing pin of a firearm strikes the primer of a cartridge the primer compound ignites sending a flame into the cartridge case. Gunpowder in the cartridge case starts to burn, causing it to change from a solid material to a gas. This change creates pressure within the cartridge, which in turn forces the bullet down the barrel and down range. Pressure building behind the bullet is released when the bullet exits the muzzle of the firearm.
The bullet acts like the cork in a shook up Champagne bottle. When the bullet exits the muzzle, pressure behind it blows the gunshot residues out of the firearm's barrel under high velocity. The residues are expelled from the barrel in a smoky cone shaped pattern.
The further gunshot residues travel from the muzzle, the broader and less concentrated the pattern becomes. Because the various elements included in gunshot residues are very small and lack mass they lose their energy rapidly.
Gunshot residues can also be emitted from other areas of a firearm. As you can see in the above image, gunshot residue is escaping from the barrel/cylinder gap of the revolver.
The muzzle-to-garment distance can vary considerably depending on the firearm and type of ammunition being used. Short-barreled firearms and lower velocity cartridges will not normally expel residues as far as a high velocity rifle. At shorter distances however, they may deposit greater concentrations of gunshot residues. Also, gunpowder can come in several forms such as ball, flake, disc, and others. Ball powder being spherical in shape is more aerodynamic than say a particle of flake gunpowder and as a result will travel farther. A number of other variables can influence the amount of gunshot residues that may reach a target; therefore, it is essential that the firearm and ammunition used in the shooting incident be recovered.
Gunshot residues emitted from the muzzle will travel out to distances of approximately 3 and 5 feet in most firearms but in some cases can travel even greater distances. At the 3-5 foot range the gunshot residues may only consist of a few trace particles and make determining the firing distance difficult if not impossible.
As the firearm gets closer to its target the residue concentrations increase and the actual size or diameter to the pattern gets smaller. At around 18-24 inches most firearms will start to deposit considerable concentrations of gunshot residues that may or may not be visible to the eye.
At distances of less than around 12 inches heavy concentrations of visible gunshot residues will normally be deposited."