In this world, worthy things don't come easy. Candy is sweeter than carrots and selfishness seems like a more direct path to happiness than service. Without instruction and encouragement it can take lifetimes to learn how empty candy and selfishness can be.
So the first way that education can help produce compassionate people is to get them thinking about the distinction between pleasure and satisfaction. It's a kind of tuning - toward accomplishment and away from procrastination, toward generosity and away from grasping, toward delayed reward and away from instant gratification, toward thoughtfulness and away from impulse. These skills are the foundation that both education and compassion are built on. Even if educators are not thinking about compassion as they shepherd students from mid-brain toward cortex they are paving the path.
The next way that education can help is socialization. Again, it isn't even necessary that compassion is in the lesson plan, it's simply easier to manage a classroom of pro-social, considerate children than a bunch of wild monkeys. Teachers encourage children to care about each other by rewarding and noticing when a child is kind and by telling stories that include examples of sharing, patience, loyalty, and other pro-social values. By shifting the student's self-image from me to us, educators help children take the first steps down the path of compassion - where we see ourselves as an indistinguishable part of all living things.
This goes further if the classroom contains small animals. The act of caring for vulnerable creatures and encouraging children to take part helps students to include other living things in their social world. Stories about animals, like Peter Rabbit, Dumbo or Bambi, teach children that animals are sentient, they have families and concerns and are able to suffer just like us.
That said, there are ways that education can shut compassion down. Sometimes educators have not awakened to compassion, themselves. They may be cruel or contemptuous toward students. They may set up a child as the class scapegoat, and give an example of how to pass suffering on rather than feel it. Even if the instructor is compassionate, and wishes to teach compassion to children, they will often hit a wall.
Compassion goes where it will.
Like water, compassion flows to low spots. For example, in the west, most people still kill and eat animals. As a child's compassion begins to grow they will ask the obvious questions and have distress. Parents and educators have to decide how to handle this. Educators are in a particularly difficult position because it is possible that the family of each child in their classroom wishes to have this handled in a different way. A field trip to a dairy farm followed up by a hamburger lunch can be a minefield for a compassionate teacher. This is a place for teacher's to exercise self-compassion as they stay in "doing their best" and "not being sure."
As young people get older, educators can continue to model and teach compassion. They can combine humility and curiosity by bringing events from history, the community or the news into the classroom and lead a discussion where they are a contributor, not an authority.