A dam is a large wall or barrier that obstructs or stops the flow of water, Most dams have a section called a spillway or weir over which, or through which, water flows, either sometimes or always. Dams generally serve the primary purpose of retaining water.