A dam is a barrier that impounds water or underground streams.
Reservoirs created by dams suppress floods and also provide water for human consumption, industrial use, aquaculture, navigability, generating electricity.
A dam can also be used to collect water or for storage of water which can be evenly distributed between locations.
The main purpose of artificial embankments is to prevent flooding of the adjoining countryside and to slow natural course changes in a waterway to provide reliable shipping lanes for maritime commerce over time.
They also confine the flow of the river, resulting in higher and faster water flow.
So as a summery, while dams generally serve the primary purpose of retaining water, other structures, such as embankments (also known as dikes or levees) are used to manage or prevent water flow into specific land regions.