Sorry, but I'm not convinced. I think you might be overestimating the Iranians - or, perhaps it's fairer to say, underestimating the problems they faced. You're also not being very fair to the Iranian army, who by the end of the war largely WEREN'T making decisions about how the war would be prosecuted.
See, the Iranian professional military personnel - officers and technicians, some of the other ranks - were generally quite capable. Not first-line NATO standard, perhaps, but not bumbling idiots by any means. Unfortunately, that meant they were also generally supporters of the Shah, and when the revolution arrived in 1979 they were instantly regarded with intense suspicion by the new regime. Many were thrown into prison, few were trusted. This hurt the navy and air force disproportionately more than the army, but even the lower-ranking professional soldiers were not considered reliable and the armed forces were generally wrecked. This is one reason the pasdaran were created, as a force which would be under the direct control of the clerics and could act as a counter to the professional military if necessary.
Look, I don't see why you are so opposed to this. The Iranians were cut off from the global arms market which absolutely did create issues for them. I will admit that. However, other than that Iran held all the advantages. Population, geo-strategic position, oil, defense spending although of course that was variable during the course of the war. The Iraqis waged a war that was the bloodiest conflict between developing countries ever and ended the war as a regional military superpower while the Iranian army was left in tatters.
And as to the Iranian army being bumbling idiots I am not arguing they were either, just that the Iraqis weren't. They were far from it, I know that. I don't think the pasdaran were bumbling idiots either. However, when you say the armed forces were generally wrecked that seems to imply something that was far from the case. It is not like they got steamrolled when the war started or anything.
Saddam had many faults, but he wasn't an idiot - he saw the way the Iranian military had been treated and knew he would never have a better chance to seize the rich coastal lands of Iran. Unfortunately, he (like many others) hadn't thought about what happens next. Any battle plan which relies on the phrase "and then the natives will welcome us joyfully" is a bad sign, and - amazingly - the people in the conquered areas didn't welcome Iraqi troops. The advance slowed and then stalled completely, and the Iraqi forces began to be pushed back.
I think Saddam was the very definition of an idiot. I mean he wasn't a complete fool, but holding him as some kind of paragon of competency would be rather disingenuous, not that you are doing that, at least I hope not. Many in the Iraqi army were against the war, but anyone that would have dared voice their reservations would have probably met a most agonizing end. And by the way, there were many in Iran who potentially would have welcome the Iraqis as liberators. The Kurds, various groups in Azerbaijan.
The invasion had come as a shock to the theocracy in Tehran, so the initial resistance to the invasion was somewhat haphazard. Air force pilots were released from prison to fight the Iraqis, and now that their abilities were desperately needed a similar sort of rehabilitation took place in the army as well. As the ex-Imperial Iranian forces got more organised and the number of mobilised soldiers and pasdaran increased, the Iraqis were forced back to the border... but no further. Once out of the foothills, the terrain no longer favoured attacks by relatively small groups on an Iraqi army that, as you say, was inept at the best of times. The clerics in Tehran were screaming for Iraq to be invaded, but this was not something that could be realistically done by the relatively junior officers and small formations that they had allowed so far. Carrying the war onto Iraqi soil would require much larger forces, and the clerics could not bring themselves to trust the army that far. Instead, they tried something else.
Actually, no, it didn't come as a shock. It was not surprising at all, they were expecting it. And, again, no, the initial resistance was not somewhat haphazard but I am not sure what you mean by that. Not all the air force pilots were in prison, not sure if you are saying that though (I'm guessing not). The Iranian air force was more than a match for the Iraqi air force early war even without the ones released from prison that had trained in America. They were forced backed to the borders, that much is correct, but then they pushed into Iraq itself, and the Iraqi soldiers were fighting to defend their country. They were no longer on Iranian soil. And I don't think I said the Iraqis were inept, at least in there entirety. They had many people in the ranks of command that really shouldn't have been there. However, generally speaking they were extremely competent if we paint the Iraqi army with a broad brush. And the terrain had nothing to do with. The Iraqis started staving off infiltration by using thermal sensors etc. and sat down for a WWI style trench war with tanks in reserve to counteract any breach in the lines. And it didn't require much larger forces than the Iranians had. It was only when that one guy (his name started with a G) got tortured in that infamous prison and forced to confess to some crime against the state early war on Iranian state television that the army was not thrilled with the regime.
They began a series of raids in force further west along the border, close to the mountains that run through the border areas, striking and then retreating before the Iraqi army could intervene. This approach was quite successful. The Iraqi army simply wasn't able to respond effectively to this; their command and control systems were so dysfunctional - thanks to Saddam's own efforts - that they reacted late if at all to these incursions and any forces they committed were getting defeated in detail. This was a form of warfare which depended on well-trained troops, junior officers who used their initiative, and a command structure that supported them. The ex-Imperial Iranian Army could do it; the Iraqis couldn't - their military culture was so centralised and controlled by Saddam, so incapable of acting independently, that they were completely incapable of defending themselves, let alone the raided territories. Just to make matters worse, the supply of expendable soldiers was running out. The prolonged war was starting to bite into Iraq's manpower pool, and what the country had of a middle class was growing restive at sending their beloved sons off to war and seeing nothing come of their sacrifices. Iraq was facing military defeat, the only hope for Saddam was for the Iranian forces to throw away their advantages and engage in huge, ponderous set-piece battles on terrain of his choosing.
Are you talking about the paratrooper helicopter raids early war up in the Kurdistan region? And yes the Iraqi army could do it, they did do it. And Saddam didn't pick the terrain, he was holding on for dear life, the Iranians had a knife to his throat.
Which is exactly what they did. The theocracy in Tehran had been growing increasingly uncomfortable with the success of these western raids. The nature of these operations required the ex-Imperial forces to be the main combatants, leaving little for the clerics to control. They could not tolerate a successful and popular army, so they tightened their grip. Control of operations was taken away from the generals, and grasped firmly by Tehran. Victory would come through the politically-reliable pasdaran, who at least had some military training, and the basij, who had nothing but passion for the cause and large numbers. The western strategy was abandoned, and attacks began across the fertile lands in the south.
Correct me if I am wrong here, but weren't the mullahs mad because the army was using the pasdaran in human wave attacks up in the Kurdistan region so they decided to purge some army guy (I mentioned before)? I know it was after this that the army started being rather lackluster in their enthusiasm for the regime.
This was a gift from Allah for the Iraqi military and Saddam. By now Saddam had been convinced of the peril he faced and allowed a greater degree of competence to surface in the ranks of his military. Funded by the other Arab states and equipped by Europe, the Soviet Union, and the USA - all of whom had reasons for not wanting an Islamic republic to thrive in the Middle East - his military had finally reached the height of its power. Its command and control systems had been improved to the point where it could now reliably perform preplanned maneuvers and carry out set-piece drills, its commanders were trusted enough to make tactical decisions, and it had a level of firepower that would have been amazing by the standards of WW1.
Saddam only relinquished control of the army at the very end of the war if that what you are talking about. And that entire last sentence, the commanders were given discretion in their command even at the very start of the war, but they were told in so many words that if they messed up Saddam would be watching, so undertandbly they didn't take unnecessary risks (if Guderian had done the things he did during the invasion of France in the Iraqi army he would have been purged). And they were reliably performing preplanned missions in the opening campaign, the invasions of Iran. It certainly did have firepower that would be the envy of WWI countries.
Which, by the way, is more or less what the war had turned into. The trusted - but not militarily skilled - pasdaran and basij were now in charge of Iranian operations, with strategy directed by the clerics in Tehran and the ex-Imperial forces reduced to supporting roles. And the politically-reliable forces simply did not have the ability to do anything other than attack. They lacked cohesion and unit articulation: their leaders might be able to direct a straightforward attack, but they couldn't stop it or get their troops to do much else. This was about as good as it could possibly get for the Iraqis. All they had to do was stay in their holes, watch as the Iranians staggered through swamps and barbed wire, were cut down by artillery, air, and chemical strikes, and then shoot any survivors who somehow got close enough.
I mean it is true that high level leaders knew that they need the army early war in order to do the planning (some of these individuals knew it as well that they were protected) but the pasdaran were militarily skilled. If they were some kind of incompetents then why did they enjoy so much success against the Iraqis early war? And the pasdaran didn't lack cohesion... They were ridiculously driven, their morale was incredibly high, they were fanatics. If that isn't cohesion I don't know what is.
However, just because the Iraqi forces were able to do this does not mean that they were extraordinarily well-developed for a third-world army. Well-equipped; yes, absolutely. Less incompetent than they were at the start of the war; of course. But they were facing an opponent who was steadfastly determined to snatch defeat from the jaws of victory, and despite that was only forced to the negotiating table by the sheer number of casualties they had sustained in 8 years of warfare. The fact that the Iraqi military managed to hold off a theocracy who was even more militarily incompetent than they were is more or less the bare minimum one would expect.
How about they weren't incompetent at the start of the war? Or, if they were so incompetent than tell me what you would have done differently please. And I don't think you seem to appreciate that they were fighting for their very survival. The Iranians had them dead to rights early war, eventually they ran out of all the armaments they had stockpiled, and had to become more resourceful in acquiring weapons, but still. And kicking the crap out of the Iranians at the end of the war, I guess in your mind counts for absolutely nothing.
In 1991, we saw that some Iraqi units (the Republican Guards, as a general rule) and some of the command structure were more or less adequate - the fact that they failed to stop the full might of the USA and its allies does not reflect poorly on them. But I do not agree that the Iraqi military under Saddam was "extraordinarily well developed for a third-world army".
Why you don't think they were very well developed is beyond me. Not many third world nations (if any) could have taken them in a war.