One of the earliest dams was built in ancient Egypt around 3000 bce. The dam protected the capital city from the Nile River's flooding. Today, most dams are designed to generate energy. Find out more about how these impressive structures are designed, built, and improved in Dams, part of the Engineering Marvels series.