There is a Torah obligation to give the priests three gifts from every slaughtered animal: the forelegs, cheek, and maw. Since priests were public servants, the idea was to support them and enable them to study Torah and teach it to the people. Today there is a custom to give the worth of the meat (not the meat itself) to a priest who teaches Torah.
There is a mitzva to sanctify the firstborn male of a kosher mammal and give it to a priest. During Temple times, the priest would offer the animal as a sacrifice and eat it. This gave him the strength to devote himself to divine worship and public service. Today, since we cannot offer sacrifices in the Temple, we take measures to avoid being required to do so. When a kosher animal owned by a Jew is about to give birth, he sells part of it to a non-Jew. Since the non-Jew is not commanded to sanctify the firstborn male, his partial ownership of the animal exempts its firstborn from being given to a priest.