Locks make a shotgun go bang. When you pull the trigger, the locks drop the hammer, hit the firing pin, and set off the shell.
This quick video gives you a good look at some Holland & Holland pattern sidelocks– the kind of locks used on some of the finest side-by-side shotguns in the world. It also compares a 5-pin lock to a 7-pin, and talks a little about the benefits of one over the other. Interesting stuff.