IMO the AT-AT is something like the star wars equivalent of a breakthrough tank, somewhat like the Tigers of WW2. Unlike the case in real life, the AT-AT, due to the marvels of shield technology, can be made invulnerable to the majority of rebel weaponry (don't really know how they work though.) Even mines, which would work against smaller AFVs, won't make a dent in the AT-AT's armour. With its 17-kilometer range heavy lasers, the AT-AT is designed to take out heavy defenses such as large-calibre guns, armoured pillboxes (if they exist in star wars), entrenched AFVs and the like. The reason why the AT-AT has to perform the role of an APC as well is simply because the AT-AT has plenty of weaknesses. It can be outflanked and cannot turn its guns to meet the enemy. It is completly defenseless in close combat, and its weaponry is not well-suited to deal with fast moving targets. A large number of speederbike-mounted infantry could easily rush the AT-AT, latch onto its weak underbelly and then dispatch the billion-dollar monstrosity with satchel charges. Therefore, the AT-AT needs support from lighter, more flexible troops i.e. infantry. You might want to argue that a number of lighter APCs could easily have done the trick, but then again do remember that the AT-AT offers the crew excellent protection. Long-range weaponry such as missiles and artillery, as well as simple minefields and anti-tank ditches, would easily have stopped most APCs. Do take into account that most sensory and communiations devices in the Star Wars universe are considerably more advanced than what was avaliable in the early 21st century. Artillery systems will therefore be drastically more effective than they currently are. As for anti-tank ditches, you would need a really deep one to stop an AT-AT. And supposing you managed to displace enough earth to do that, you would have to position your defenses outside the range of the AT-AT. Moreover, the ditch protects the AT-AT from attack as well, since the trick to destroying an AT-AT is to get close. All this is, of course, assuming that the enemy can field a first-rate defense system, which was not the case in Hoth. Such elaborate defenses are nonetheless fairly ineffective against an AT-AT. Hence, it can move into position and surpress enemy defenses, clearing the way for the rest of the attacking army. When threatened, it can deploy its infantry for self defense. The infantry also can be used to flush out and capture strongpoints as trenches and bunkers, something the AT-AT would never have been able to do on its own. The AT-AT is actually a fairly sound concept, although if would never have worked in real life (until shields are invented, that is).