Before us is Maseches Sotah, chapter 9, mishnah 2. This mishnah comes to limit the cases in which the mitzvah of eglah arufah can be fulfilled, listing situations in which the body was found in a place that is not fit for it.
A body that is not lying on the ground:
The mishnah opens: "nimtza tamun b'gal, o taluy b'ilan, o tzaf al p'nei hamayim - lo hayu orfin" - if the body was found buried in a heap, such as a heap of stones, or hanging on a tree, or floating on the surface of water, the mitzvah of eglah arufah is not performed for it.
These three laws are derived from the wording of the verse:
"ba'adamah" - "in the ground": that the body be lying on the ground, and not buried in a heap.
"nofel" - "fallen": that it fell, and is not hanging on a tree.
"basadeh" - "in the field": in a field, and not floating on the surface of water.
Places from which one does not measure:
The mishnah continues: "nimtza samuch lasfar, o l'ir sherubah nochrim, o l'ir she'ein bah beis din - lo hayu orfin":
"samuch lasfar" - near the border, in a place close to the enemies of Israel.
"l'ir sherubah nochrim" - near a city whose inhabitants are mostly non-Jews.
"l'ir she'ein bah beis din" - near a city that has no beis din.
The reason for the first two cases, near the border and near a city of non-Jews, is explained in the Gemara from the wording of the verse: "ki yimatzei chalal" ("if a slain person is found") - "perat lematzui" - excluding a case that is common. In a place close to the enemy, at the border or near a city of non-Jews, it is a common occurrence that trouble breaks out and a person is killed, and this is not an unusual finding.
In the case of a city that has no beis din, however, the intent is not that the mitzvah of eglah arufah is cancelled entirely, but rather that one does not measure to that city and it does not perform the eglah arufah; instead one measures to the nearest city that does have a beis din. This is what the mishnah goes on to explain: "ein modedin ela me'ir sheyesh bah beis din" - one measures only from a city that has a beis din.
"Nimtza mechuvan bein shtei ayarot":
What is the law if the body was found at exactly the same distance from two cities that each have a beis din? On this the mishnah says: "shteihen mevi'ot shtei agalot, divrei Rabbi Eliezer" - both of them bring two calves, in the words of Rabbi Eliezer. Rabbi Eliezer holds that it is possible to pinpoint precisely, that is, an exactly equal division can in fact exist. And since that is so, when the Torah says "the nearest city," it may be understood as "the nearest cities," in the plural, referring even to more than one city.
The halachah, however, does not follow Rabbi Eliezer's view. It was established that one cannot pinpoint precisely - there is no reality of a perfectly exact measurement. Therefore the two cities do not bring two calves; rather they bring a single calf and make a stipulation between themselves: "If you are the closer ones, it is yours, and if we are the closer ones, it is ours."
Jerusalem:
Finally the mishnah says that if Jerusalem is the nearest city, it does not bring an eglah arufah. The reason is that the verse states that the slain person was found "in the land that Hashem your God is giving you to possess," and Jerusalem is not considered part of the inheritance, since it was not divided among the tribes but remained separate. Therefore, instead of measuring from Jerusalem, one measures from the nearest city that has a beis din, as stated above.
In summary: This mishnah limits the mitzvah of eglah arufah in several directions: with regard to the condition of the body, that it be lying in the ground, fallen, and in a field, and not buried in a heap, hanging on a tree, or floating on water; with regard to the place where it was found, that it not be near the border or near a city that is mostly non-Jews, because "ki yimatzei" comes to exclude what is common; with regard to the city that is measured, that it have a beis din; and with regard to Jerusalem, which is not included in the inheritance that was divided among the tribes. We also learned the dispute of Rabbi Eliezer and the halachah in a case of a body found exactly midway between two cities, that they bring one calf and make a stipulation between themselves.