Stars define your history. It sings the tales of your deeds which you have partaken in, in the past. It's not exactly one's strength that defines stars, but yes, to gain stars, strength is one big factor.
The Headmaster is a Seven-star magician, however, in pure combat, he wouldn't be able to defeat Jullie—who is a Five-star combatant.
He had fought two major wars and defeated several high-ranking warriors and monsters during that period that granted him those stars.
Edric, who is a three-starred warrior, has gained fame through his performance in the academy. Like during the first raid the students went through in the first year, Edric saved them from a chimera that appeared out of nowhere. And also, no one could forget the tournament of last year.
Edric fought a second battle and even that, against the strongest warrior from the other side. There is a long list of feats he has achieved after entering the academy.