When it rains, where does that water go? Certainly, you’ll see streams of it running along, but you’ll also see it soaking *into* the ground. Dirt is, after all, fairly absorbent.
Just like water outside of the ground, water in the ground flows down and downhill. The result is a “water level” under the ground, beneath which you’ll find water. Dig a hole down here, and that water will fill the bottom of it. That’s a well.
Don’t put something poisonous in the well, and it’s safe to drink. For a town well, that would be more or less an act of terrorism. Provided nobody does that, there’s nothing wrong with sharing a well.
Latest Answers