The Inca couldn't farm in the valleys. The land in the valleys was very fertile but they couldn't farm because there was glaciers in the Andes. In the spring when the glaciers melted, the valleys would be completely flooded and anything that they would plant just got washed out.
So they developed a system where they actually built the farmland into the sides of the mountain so they could farm in the mountains and use the runoff from the glaciers to water their terraces.