If a person leaves his techum on Shabbos or Yom Tov, he is constrained (for the rest of Shabbos or Yom Tov) to an area of four amos. One who leaves the techum for kevuras hameis (when it is permitted), however, may return home after the completion of the burial. This is because Chazal did not want to discourage people from escorting a meis outside the techum. If there is another Jewish settlement within the techum of the cemetery, however, a person would only be permitted to walk to that city and not to his home. A paid member of the burial crew or a family member may not return home (past the techum). It is assumed that people in these categories would walk to a burial despite the restriction, so there is no concern about discouraging them from escorting the meis.
[שו"ע תקכו, ו, משנ"ב לה, וביה"ל ד"ה וחוזרין; וראה שעה"צ מו]