Answer:
When a gun is fired, the gunpowder burns very quickly, and produces a gas that pushes the bullet out of the barrel. The remaining gas pushes out of the barrel very hard and fast (which is why guns go BANG) and leaves traces of chemicals on things close to the gun. Some of these chemicals are found in very few things other than gun powder. Chemical tests can identify those chemicals that are left on hands, clothing, etc.