Locks are devices used on canals and rivers to raise and lower boats between stretches of different water levels. A lock has a fixed chamber where the water level can be varied, allowing boats to move up or down to the next stretch of water. Locks help boats navigate waterways with changes in elevation.