Nobody knows for sure when or where the Hanging Gardens of Babylon were built, but they were already famous as one of the Seven Wonders of the World in the Hellenistic period, about 200 BC. The most likely explanation is that the gardens were part of the palace of the Assryian king Sennacherib in Nineveh.
About 700 BC, Sennacherib built a big, beautiful palace in Nineveh, and he built gardens to go with it. The water to feed the gardens came from a fancy system of eighteen canals, with an aqueduct at least forty miles long. But Nineveh was on top of a hill. It was hard to get the water far enough up the hill to water the garden. Many people think that Sennacherib's architects designed the first screw pumps to solve this problem. The new screw pumps seemed exciting, and that's why this garden was included in the Seven Wonders of the World.
The wooden screw pumps were carved out of sections of logs, where the outside of the log stayed in one piece, and you carved the inside into the shape of a screw - a spiral. Or possibly the inside screw was cast in bronze. Either way, the whole cylinder turned, and as water moved up the spiral eventually it came out the top. There it entered a second screw pump, and so water gradually moved up the hill to water the plants at the top.
Using a screw pump for irrigation
So if it's in Nineveh, why was it called the Hanging Gardens of Babylon? Apparently the Assyrians used "Babylon", which means "Gate of the Gods", for Nineveh and other cities as well as for the city we call Babylon.