Whether you're talking about a handgun, a rifle or a shotgun, all modern guns have to do some of the same things. They have to send ammunition flying out of a long cylinder called a barrel, and they have to allow for the loading and unloading of new and spent ammunition. When you pull the trigger, a hammer or firing pin strikes an explosive charge on the back of a cartridge or bullet. This causes a small explosion that changes the air pressure in the barrel, forcing whatever was in front of the explosion (such as a bullet or metal pellets) out the other side at an extremely fast speed.
Shotguns are designed to fire batches of small projectiles instead of single bullets with each pull of the trigger. These projectiles themselves don't have to be aerodynamic like bullets and aren't expected to travel long distances. They are designed to cause their worst damage at closer ranges. Shotgun ammo comes in varying shapes and sizes and includes lead, steel and bismuth pellets, bean bags, rock salt and rocket-like sabots. Shotguns can also fire individual metal slugs.