If you’ve done genealogy for any length of time, you’ve encountered endogamy. It’s the practice of marrying within the same community one generation after another. That community is often a geographic one, but it can be also ethnic, socio-economic, religious, etc. And there can be overlap as geographic communities often share a common ethnicity and religious heritage as well.
My maternal ancestors were Ostfriesen immigrants to a two-county area of the United States. For the first three generations in the United States, they married other members of that community–they had a shared culture and religious heritage. We’re all related to each other in more than one way which is what happens when small villages of populations under 500 people move to new areas of about the same size.
My Kentucky families who migrated to Indiana, and eventually Illinois married into other families from the same general area. The pool of potential marriage partners was somewhat larger, but the concept was the same.
And I’ve got a group of families who started out on the Virginia coast in the late 1600s and generally moved together into Orange County, then Amherst County, and eventually into Bourbon County, Kentucky. The same last names appear as neighbors in most of their documents over a one hundred and fifty year time span.