How do latching mechanisms work?

Latching mechanisms are used to keep doors and other objects close. The most common type of latch is the door handle, but there are also latch mechanisms for windows, cabinets, drawers, and