A lock is a device for raising and lowering boats between stretches of water of different levels on river and canal waterways. The distinguishing feature of a lock is a fixed chamber in which the water level can be varied; whereas in a boat lift, or on a canal inclined plane, it is the chamber itself that rises and falls.
Locks are used to make a river more easily navigable, or to allow a canal to take a reasonably direct line across land that is not level.