The Mishnah in Maseches Gittin (Chapter 5, Mishnah 8) opens by listing a series of enactments that the Sages instituted for the sake of peace: "Ve'eilu devarim amru mipnei darchei shalom" - and these are the things they said on account of the ways of peace. We will go through them one by one and clarify the reason behind each.
The order of aliyos to the Torah:
"Kohen korei rishon, ve'acharav Levi, ve'acharav Yisrael" - the kohen is called to the Torah first, after him the Levi, and after him the Yisrael. The Gemara explains that the precedence of the kohen originates in the Torah, for we were commanded to give him precedence. Strictly speaking, however, a kohen may waive his honor in favor of his teacher or in favor of someone greater than him in wisdom. The Sages therefore enacted that at the public reading of the Torah, before the congregation, the kohen may not waive his precedence and hand it to whomever he wishes, not even to his teacher. Rather, the kohen always goes up first, after him the Levi, and after him the Yisrael. And all of this is for the sake of the ways of peace, so that people should not come to quarrel and argue over who is fit for the next aliyah.
Eiruv chatzeiros:
"Me'arvin b'bayis yashan" - when residents live together in a single courtyard and need to make an eiruv chatzeiros, which joins their food together so that they may carry in the courtyard on Shabbos, the practice was to place a loaf of bread or a matzah in one of the houses in which they all have a share. The Sages enacted that the eiruv should continue to be placed in that same old house where it was regularly placed, even when new residents join, and all of this is for the sake of the ways of peace.
The Gemara brings a further explanation, that this is not literally on account of the ways of peace but in order to avoid suspicion: when people see that the eiruv is not in its usual place, they are liable to think that there is no eiruv at all. According to this explanation it is not a reason of the ways of peace in the plain sense, although suspicion of this kind could ultimately lead to a lack of peace.
Filling the pits from the irrigation channel:
"Bor she'hu karov la'amah mismalei rishon" - when an irrigation channel passes along the boundary of various people's fields, and they fill their pits from it, the owner of the pit closest to the channel is entitled to fill his pit first. Once this practice is fixed, there is no longer room for argument over who fills first, and this is for the sake of the ways of peace.
Acquisitions instituted for the sake of the ways of peace:
From here on the Mishnah discusses types of acquisition that are not a complete acquisition by Torah law, where the object does not strictly belong to the person, but for the sake of the ways of peace the Sages enacted that it be considered his even though he did not perform a complete act of acquisition:
"Metzudos chayah ofos v'dagim yeish bahem mishum gezel" - the nets and traps that were spread to catch wild animals, birds and fish: one who takes the catch from them is guilty of theft for the sake of the ways of peace. For strictly speaking these vessels do not have the status of a vessel that acquires for its owner, and nevertheless the Sages treated the catch as belonging to the trapper, so that people should not complain and say: you took the thing I labored over.
The find of a deaf-mute, a shoteh or a minor - objects found by a deaf-mute, a shoteh or a minor: one who takes them from them is guilty of theft for the sake of the ways of peace, so that people should not go about snatching their possessions.
"Ani ha'menakeif b'rosh ha'zayis" - a poor man who beats an olive tree and knocks down from it olives of pe'ah, shichechah or the other gifts to the poor: what falls beneath him is considered his, and one (another poor man) who takes it from him is guilty of theft for the sake of the ways of peace.
In all three of these cases, even though it was established that they constitute theft, the object is not extracted from the taker through beis din. Rabbi Yosei disagrees and says "gezel gamur" - complete theft. He does not mean that it is theft by Torah law, for in his view too it is only rabbinic; rather, in his opinion the object can be extracted from the taker by turning to beis din, and the owner will get back what is his.
The attitude toward the poor of the gentiles:
Finally the Mishnah says: "Ein memachin b'yad aniyei goyim b'leket shichechah u'v'pe'ah" - we do not protest against the poor of the gentiles who come to gather the gifts to the poor, and this is for the sake of the ways of peace, so that we live in peace with our neighbors.
Similarly, the Gemara brings a beraisa: we support the poor of the gentiles along with the poor of Israel, we visit their sick along with the sick of Israel, and we bury the dead of the gentiles along with the dead of Israel - not in the same burial place, but we become involved and see to it that it is done - and all of this for the sake of the ways of peace.
In summary: in this Mishnah we listed the enactments made for the sake of the ways of peace: the precedence of kohen, Levi and Yisrael in the reading of the Torah; placing the eiruv in the old house; the precedence of the pit closest to the channel in drawing water; the recognition of the acquisition of those who spread traps, of a deaf-mute, a shoteh and a minor, and of the poor man beating the olive tree, together with the dispute between the Tanna Kamma and Rabbi Yosei whether the object is extracted through the courts; and finally the attitude toward the poor of the gentiles regarding leket, shichechah and pe'ah, and regarding support, visiting the sick and burial - all so that we live in harmony and peace.