A lock is a hydraulic passage system that allows ships to navigate despite differences in levels.
Operation of a lock
A lock consists of two gates that enclose a lock between the upstream reach and downstream reach. To cross the difference in levels between upstream and downstream, a ship moves into the lock. It then waits for the upstream water to enter, or the downstream water to exit, thus placing it on the level of the water in the next reach. The corresponding lock gate then opens, releasing the ship to continue navigating.
Advantages of locks
The advantage of this system is that it consumes very little energy to raise or lower the often large mass of a ship, since it uses hydrostatic pressure.
A lock on the Nile. © Morburre, Wikimedia CC by-sa 3.0