A stapler works by using force to push a staple through the paper, then secure the pages together. It can be used for locking pages of a document together, or for tacking, when the stapler is opened up and used to staple items to a flat surface.
There are eight significant parts that come together to make this happen, as labeled in the diagram above. First, the stapler itself is composed mainly of the head (1) and the base (4). Connected to the head is the magazine (2), which holds the staples (5). The head is connected to the base by a hangar (8), which is soldered in place. The pin (6) at the back of the stapler allows the head to swing up and down to load staples or in some models open up completely for use in tacking items. Inside there are springs (7) that have two purposes. One spring pushes the staples down the magazine to reload the stapler. The other works to pull the stapler head back up after it has stapled a document. On the base, there is an anvil (3), which is a metal plate that the staple is forced into that ultimately makes the bend in the staple that secures the pages together.
The staples are loaded into the magazine so that the two points face towards the base of the stapler. The spring creates tension that pushes the staples toward the front of the stapler. When pressure is applied to the head of the stapler, the magazine pushes down on the paper, and a metal plate in the head of the stapler pushes the front staple down the magazine. The two points are forced into the paper, piercing the pages until they come into contact with the anvil. There is a curved groove in the anvil. The ends of the staple are forced into this groove, where the pressure forces them to bend. They bend inwards, creating a lock around the pages.
Tacking is used for stapling items to flat surfaces, like walls or bulletin boards. A button is pressed on the bottom of the stapler. This releases the magazine and head of the stapler. The stapler works as it would for regular stapling, forcing the staple out through the magazine, only it is not forced into the anvil. It pierces the paper and the surface, and pins them together, much like a push pin or thumbtack.