The priests and the nobles made up the upper class of the Maya people. (The merchants and traders were the middle class. The farmers and slaves were on the bottom.) The nobles ran the government. The priests ran everything else. Some priests also held government jobs. The nobles might have believed they were in charge, but it was the priests who had real power.
The Maya people believed their priests could talk to their gods. The priests told the people what the gods had said. No matter what your class, there was no arguing with the gods.
The priests told the people when to plant, when to harvest, when to marry, who to marry, when to make a personal sacrifice, how to behave, and when to go to war. The priests were incredibly powerful.
Festivals were held every 20 days in each Maya city, to honor the many Maya gods. The priests of each city conducted the religious part of these festivals. They danced on the steps of the temple, wearing elaborate and rather scary costumes, so that the people could see them communicating with the gods.
There was one type of priest who acted as teachers for the children of the nobles. These priests taught math, science, astronomy, medicine, writing, and of course religion.