To put it simply, the water found in wells comes from the ground. It works by accessing underground aquifers. The wells are holes that penetrate the water table of the Earth. Here, the wall of the well then separates the groundwater from the ground, leaving water in the well. Modern wells deliver water using a pump to raise water to the surface, but traditionally buckets were used (source).