Lots of weird ways that all somehow worked out. It had to be balanced in 3 ways at the same time, players vs enemies in the game, players vs players if they fight each other, and players vs enemies but comparing each class against each other. Each class had to be 'desirable' to play and to have in a group, but they were all wildly different so it seemed impossible to balance but it somehow mostly worked out well.
For players vs players the spell casters are so frail they die in seconds if hit. Tanky types don't have spells but can resist a lot of spells, and they can bash and stun which interrupts spell casting. Also spell casters can't cast spells while moving they had to stand still, and if you stand still another character can just hack you to death in a few seconds. So you had to run away and then snare them or roots to hold them in place to keep some distance, cast some spells, and then be ready for when the snare breaks randomly. Healers did ok because they have a healing spell that pulses every few seconds for a minute or so. So they can cast that on themselves and then go hit the other guy and use stuns, smite, etc. And the long lasting healing spell will protect them for a while. Mages so frail, but had a spell called shadowstep which randomly teleported you about 50 foot in any direction. Great way of falling off a cliff to your death, but sometimes you ended up in some trees or something and could slip away =) Mages can go invisible which helps too.
For players vs game enemies, it balanced because most of the enemies were designed for full party of 6 people. So they are really tough and come in large groups and help each other out and stuff. So magic had the freedom to be pretty powerful, because the fights were all brutal. So you could rain fire or lightning, charm enemies to become your controllable pets, make stuff run in fear, hold stuff in place, put stuff to sleep, slow their attacks, drain their mana, cripple their strength, etc. So you had powerful abilities but with tough fights you needed them. And spells used mana which took ages to recover so you couldn't just go around blasting everything. It might be better to use a low level spell that just reduces the enemy's armor class a bit, then let your pet beat it up. But know when to unleash mayhem when it's needed. And spells take a long time to cast, like 6 seconds which in the chaos seems like a long time. In that time some characters can land a lot of melee attacks and do plenty of damage, so things mostly balance out.
The classes varied drastically in damage output and sometimes people whined about it, but the balance was in other ways. Like a Necromancer couldn't nuke as hard as a Wizard but he had a pet and could feign dying to fool enemies and stuff. Enchanters sucked at damage but they were kind of gods of the game, being able to save everyone time with faster mana regeneration and they could put entire rooms full of enemies to sleep. Sometimes it put themselves to sleep at the same time, and they'd die in sad/hilarious ways, but it mostly balanced out =) That was my favorite class of all, they were known for charming an enemy to make it your pet, and eventually they got Dire Charm which kept it as your pet permanently. I used to charm this really badass crocodile and my friend was a Cleric who buffed the crock up with Heroism and Strength and stuff, and we'd go out and slaughter stuff with our roided up pet Crocky.
That game really should be studied or something. Jenga champion of game design.