How does a barrier across a river create a source of fresh water?

A barrier (a dam) creates a reservoir of water which can provide a consistent supply of fresh water. Without the reservoir, the supply of water during some parts of the year would be inadequate for practical purposes.