How does a well actually work to supply drinking water?

If you look beneath the surface of the landscape, you will find a complex mixture of rock, gravel, sand or finer-grained material that makes up areas where water can be stored in pore spaces. Gravity causes rainwater or melted snow to move down into the empty spaces in between the soil or cracks in the rock. Eventually the water reaches the saturated zone. In the saturated zone all the void spaces are completely filled with water; the water in the saturated zone is what we call groundwater. The geologic formations of rock and/or soil that transmit and store groundwater are called aquifers.
A well is simply a vertical hole in the ground that extends past the water table and into the saturated zone. Water from the surrounding aquifer fills in the vertical hole, or well, which can be pumped. As water is pumped out, water from the surrounding aquifer seeps back into the well borehole.
Modern wells have a casing or pipe in the borehole that is grouted and sealed at the surface, and also extends above the ground surface, to prevent contaminated surface water from polluting the well. See the EPA’s Private Drinking Water Wells: Basic Information page to see well diagrams.