Water gets into the ground from rain and other precipitation that falls from the sky and soaks into the ground until it reaches the water table and aquifer.
As the water seeps into the ground it is naturally filtered by the soil, sand, gravel rocks etc that are in the ground and if you have a well that is at least 100 feet deep or more the water is likely very clean and filtered really good.
Water can also seep into wells through the ground from rivers and lakes.
The water in the ground which reaches your well can also come from several miles away as it flows through the ground.
The rain and precipitation that fills your water wells does not have to be local to your well.
Water comes from the ground by use of water wells which are dug or drilled into the ground until water is reached.
In some locations wells can be dug to reach water when the water table is at a shallow depth and in other places a well will need to be dug deep or drilled deep into rock to reach water underground.
The wells access the ground water which flows through sand, rock, gravel, dirt etc through the ground.
Then a pump which is usually a submersible pump in deep water wells pushes and pumps water to the surface and into homes, business etc.
Shallower wells may use a jet pump that uses suction to lift the water to the surface and some hand dug wells use buckets to get the water.
The water that is in the ground comes from rain and when it rains the rain seeps into the ground and eventually reaches the water table.
The depth of the water table can be a few feet below ground or 50 feet and sometimes deeper.
In my location I can dig down to 2 to 4 feet and water comes pouring in the ground which is where the water table is.
I still have to dig or drill deeper for cleaner water but I can access some water at 2 to 4 feet.
I have a water well on my property that is around 150 feet and will likely never run out of water due to the high water table around here.
My well uses a submersible pump which is in the well and pushes the water up to the surface.
The water in the well is likely thousands of years old and flows in from all around and can even come from miles away from the well.