Iran has followed almost the same strategy in Syria and Iraq. Tehran did not trust the Syrian military to put down the protests in 2011 and the ISF was disintegrating after the fall of Mosul in 2014. With the unreliability of the government forces Iran pushed to using militias. In Syria Iran advised and helped create the Shabiha, the Popular Committees and then the National Defense Force. As the fighting intensified it also brought in its militia allies from Syria. It advised the Syrians at the strategic and tactical level and sent in thousands of its own fighters into Syria as well as using Hezbollah for advising and combat operations. Similarly in Iraq Iran sent in advisers to form strategy as well as at the tactical level. Jan 2014 Iraqi militias were starting mobilization for fighting in Iraq and have become the backbone of the defense forces. Many brought back their fighters from Syria for deployment to Iraq. Hezbollah is also operating as advisers in Iraq. Iran wants Damascus and Baghdad to defeat their insurgencies and to increase its influence which it has exponentially done as it is seen as THE key ally supporting the home governments. In Iraq there is an additional goal which is to make sure Iraq does not emerge as a powerful state again, because it doesn't want that rivalry reborn as it was during the Saddam era. Tehran has far greater ability to make sure Iraq doesn't come out of this war a strong country now than ever before. Here's my complete article on the topic.