Waste water is used to replenish groundwater stocks through a process known as artificial groundwater (or aquifer) recharge. The idea is simple enough, though variations of the process may be used.
The wastewater (with or without treatment) is sent to the aquifer or groundwater body through a deep well. Depending on the discharge available, the wastewater may either be stored first in basins or directly pumped into the recharge well. Due to this injection, the water table rises during the wet season and may be improved for dry weather conditions. This recharged water can be utilized during the lean or dry weather conditions.
If the wastewater is treated beforehand, it can be recovered earlier than in the situation where the wastewater is pumped to the aquifer without any treatment. In either case, some natural attenuation of the wastewater may take place, cleaning it before it is reused.
Aquifer recharge systems have been adopted around the world. I am attaching couple of images that will highlight the points made above.
Hope this helps.