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.