95:1 On Shabbos or yom tov, one may not travel beyond his "home base" more than 2,000 cubits. A person's "personal space" is four cubits. (A cubit is about 18 inches.) Therefore, if one was in a field at twilight but spending Shabbos in the city, the entire city is considered his place, and the city outskirts are like the city itself. The outskirts are 70 2/3 that are part of the city even though there are no buildings there. This is called the karpeif and the Shabbos boundary is measured from there.
95:2 One may travel all throughout a walled city, even if it's very large, plus its outskirts, from which we measure the Shabbos boundary. Similarly, if a city isn't walled but its houses are close together, as long as the distance between the houses is no more than 70 2/3 cubits, they are considered as attached and part of the city. This is true even if the city is so large that crossing it takes several days. The Shabbos boundary and the karpeif are measured from the last house.