Iran had 35 million people at the time. Plus, it had just gone through a revolution, had just purged almost all of its military officers and generals, and was fighting a quasi-civil war with MKO and Kurdish separatists when Saddam attacked. It was also under a total arms embargo by the west and the Soviets. Iran's largest military weapons supplier (supplies which paled in comparison to the supplies Iraq got) was China, who in fact sold to both sides.
Saddam in comparison was better armed, much better prepared, had the political, financial, and military support of the US, Soviet Union, Europe, and entire Arab World, and most importantly, had chemical weapons, and freely used them with not a single protest from the UN.
If it were any non-Arab country (like Turkey, Pakistan, or hell, even Afghanistan) attacking Iran instead, Iran would have collapsed instantly and lost a vast amount of land.