Dungeons and Dragons is a very imbalanced game, especially in regards to classes.
In 1st Edition, the classes were intentionally designed to be more/less powerful than each other at different levels. Low-level Magic-Users were designed to be very weak in the beginning, but really powerful at high levels. Fighters, conversely, had more staying power at low levels but got eclipsed in power later on in the campaign.
I don't think that this premise worked out as intended; a low-level Magic-User with the right spells is a glass cannon (weak but packs a powerful punch) with certain spells, such as charm person. As for having things equalize by giving everyone there moment to shine at certain points, there's no guarantee that a campaign will go from 1st to 14th, or even 22nd level. The Magic-User's power was an in-game reward to long-term group play.
I'm not fond of this idea; sometimes I like to run one-shots or short campaigns, and sometimes I want the starting point of a game to be at a higher level of power.
3rd Edition is incredibly unbalanced, even with just the Core books. Ever heard of CoDzilla? It destroys niche protection! A Cleric can be a better necromancer than the Necromancer and melee better than the Fighter. And let's not forget that "trap options" were intentionally designed into the system via Ivory Tower Game Design. Fighters and martial characters, whether by feat or prestige classes, got niche abilities less useful than a stock assortment of spells most of the time.
4th Edition was an attempt to make a balanced game, and in comparison to 1st and 3rd it IS more balanced. But supplement bloat and bad early design of skill challenges worked against it. Also, certain builds can be vastly more powerful than others (there's a way to get a Swordmage to rely on Intelligence for everything). I don't know much more about the mechanics of the system, so a 4th Edition expert can chime in.
Since D&D's a combat-heavy and rules-heavy game in most of its incarnations, having hard-and-fast rules for class powers is necessary. And every class needs ways to contribute both inside and outside of combat.
My ideas for solutions:
Give Mundanes nice things: We've all heard of the dreaded scenario when a flying monster forces the Fighter to rely on a bow he can't use well at all, a monster's blindsight/super-senses foiling a Thief's Stealth check, or spells invalidating entire skills. Sometimes the Wizard dies from a well-placed critical hit, and the Cleric's been afflicted with some eternal sleeping curse. The amount of enemies in D&D which can fly, ignore non-magical attacks, and otherwise bypass mundanes is immense. A party without spellcasters should not be irreversibly boned when fighting other casters and most types of monsters. If we're going to leave spellcasters with a big toolbox of mobility, combat, and ranged spells, then Fighters, Barbarians, Thieves, and other noncasters need abilities of useful equivalency independent of DM Fiat to contribute to the party.
Also, realism and the laws of physics have no place in D&D, especially when they just apply to noncasters.
Role Protection: Every class role, mundane or magical, needs to do unique things that the other roles cannot do. Fighters, Thieves, and noncasters should have innate abilities which can't be replicated by spells.
There should also be restriction on magic, and the idea of "themed casters" is a good idea, like what they did with the Dread Necromancer and Beguiler in 3rd Edition; the Necromancer was good with the undead, but screwed when it came to replicating illusion and divination magic.
D&D's a team game: A good team has particular strengths and skills to aid the party's performance and cover up weaknesses. This means that everything should be capable of contributing and that common enemy tactics shouldn't invalidate entire classes. Classes/abilities which are useless more than 50% of the time pull the rest of the party down and hurt everyone's survival rates.
There's an infinite power loop, that's okay:Many games are chock-full of rules exploits and cheesy combos, and D&D is no stranger to these sorts of shenanigans. Ideally, these things will be few and far between; but just because they exist does not mean that the game's irredeemable; on the contrary, a lot of the ones in D&D require excessive number-crunching beyond routine optimization and ruin the fun for everybody else in the game. If you manage to stumble upon it accidentally, I don't think anybody would complain if the group "retconned" things down to a more reasonable level. I realize that I'm arguing in favor of DM Fiat in extreme cases of unstoppable power, because it never ends well for anybody.
Magical Tea Party will always exist: As I mentioned right before, DM Fiat can be good in some cases. Except when it comes to core conceits about the game or things which happen with regularity; we wouldn't want to pay money for a war game that has no rules for mass combat. DM Fiat should not serve as an end-all be-all solution to class imbalance. Ideally every class can stand on its own without the DM swooping in to fix things.
But there's always going to be things that the rules don't cover. I don't think that the game is enhanced with extraneous details for things which may never come up in most games, such as rules for an intricate economic system. How do you calculate the gp value of wooden arrows in a desert region X miles away from a forest, or factor the precise standards of living from an emerging middle class in an industrial society? Details on these things can add to the world and represent change and interesting adventure hooks, but it's fine for the DM to say "the orcs took over the mines, meaning that metal goods are up 200%" instead of busting out a huge stack of text to calculate the value of forged iron by the pound based on hundreds of factors.