It’s typically sourced from natural/artificial surface bodies or pumped out of the ground.
Treated waste water is very commonly used as well. Just not normally for vegetables intended to be consumed fresh. Its mostly used to grow animal feed and non-food agricultural products.