I know what a lock is. But what is a latch? It seems that it is similar to a lock. What's the difference?
A latch fastens a door, gate or window in position but does not provide security. (See Wikipedia.)
A lock prevents anyone without a key from opening a door/gate/etc.
A latch keeps something closed but does not lock it.
A latch is a very simple device that keeps a door or window closed. On a door, it is simply a sliding piece of metal or wood that slips into a slot, or even a piece of rope with a loop that can go over a small post.
A lock needs a separate device (a key) that will unlock the lock.