Irrigate an arid environment sufficiently and the microclimate will be altered to less arid via evaporation. Deserts come and go, tremendous ancient cities are buried in desert sands. This region, too, was once much less arid. That groundwater didn’t just materialize out of thin air.
There is irrefutable evidence that proves the Sahara was once covered by the Ocean.
In fact, there is an area called "Valley of the Whale" because of all the whale bones and other ocean specie fossils that have been found there.