Afghanistan war is termed as a war being fought against terrorism, while the Iraq war is a war termed against the Saddam regime, which was posing a threat with mass destruction weapons to the world. The code name given to the Afghanistan war was Operation Enduring Freedom, while the code name given to the Iraq war was Operation Iraqi Freedom.
The war in Afghanistan was against terrorism in Afghanistan, especially the Taliban, while the war in Iraq was just against the Saddam regime and his government supporters. The Afghanistan war took place in the year 2001 with support from the United Kingdom and few other locations, majorly meant to terminate the Taliban regime with their terrorism.
Iraq was a bone of contention for the United States during the reign of Saddam Hussein in government. In the year 2002, the United States government decided to wage war on Iraq, but they could not get support from the United Nations. Nevertheless, they went ahead with the war in 2003, and they ended up being successful at bringing an end to the Saddam Hussein threatening government.