A lock is a chamber that can be filled or emptied of water. When a ship enters a lock, water is either added to raise the vessel to the level of the next section of the canal or drained to lower it.