In order to understand what a levee is one must understand a river system. A stream may be joined by tributaries (side streams) that finally merge with a larger stream or a river. A river finally empties into the sea. All the streams and the river make up a river system. Excepting a few like the Volga of Russia, the Great Salt Lake in western US and Lake Chad in Africa, every river system finally flows into the ocean.
Mounds of coarse sediments built up by rivers themselves on the river bank are called levees or dikes. It forms either naturally or can also be artificially constructed (something like a wall) to prevent floods and confine the flow of water. Levees keep the river from overflowing its banks or stop waves from entering into undesired areas.
When there are floods, water slows down at the river banks depositing a lot of silt on the river banks and much less on the flood plain. Flood plain is the area around the river that is covered in times of flood. It is a very fertile area as rich alluvium soil gets deposited by floodwaters. This build-up of fertile soil on the banks of the river creates levees. When there are repeated floods, the levees become so high that the water level in the river becomes well above the surrounding plane.
Levees are also known to be one of the methods of controlling floods. It acts like a barrier against the sea. The dikes of Holland are known to the safest levee system in the world. There are windmills put up behind the dikes that pump out the water from behind the dikes to keep the land dry.
Though the levees act to stop floods, they can be broken when the nature gets quite powerful.