Cotter Pin
A cotter pin is one of the most commonly used types of pins. There are many design variances of the cotter pin, some of which look very much like a bobby pin. They are typically used to keep a fitting from pulling out. For example, an axle end might be placed through a bearing. The axle end may he held in place solely by a cotter pin; or, it may be threaded and tightened with castellated nut used in conjunction with a cotter pin, preventing both pull-out and nut-spin.
Shear Pins
A shear pin is designed to hold something in place, but only up to a certain amount of force. Shear pins are designed to fail under specific circumstances. Much like a rip chord, it provides strength and functionality through a range of force, outside of which, it releases through breaking. Shear pins give engineers a means of prioritizing failing. For example, an engineer may use a shear pin in an application where mechanical failure may prevent human injury.
Slotted/Hollow Pins
Slotted pins behave like a rolled up paper. Once rolled up, they want to expand. Slotted pins are rolled into a near-circle, so their cross-section looks like a "C". They are inserted into a hole slightly smaller than their diameter, tightening up the C-shape. This leaves the pin with constant tension against the walls of the hole, fixing it in place without the need for for a threaded fastener.
Dowels
Machinists use dowels in a similar way as woodworkers, but the purpose is usually precision alignment. Dowels also come in a variety of sizes and design variations. They are often made of hardened steel. They may be used for both alignment and a bearing surface. An example of dowel use is a locating pin. Locating pins can be used when two surfaces have been mated approximately, and the pin uses it's shear strength to hold the two surfaces in precisely the same relationship to one another.