That was one of the things that Iran was SUPER worried about. That's why they supported the insurgencies in both countries so heavily.When we were in both IRQ ans AFG, we should've used the opportunity to pop the zit that is Iran.
But as hard as they pushed, we pretty much did... nothing. Nothing that mattered, anyway. So they kept pushing harder and harder, and eventually we decided to leave.
Iran was the big winner of the US wars in Iraq and AFghanistan. And they will be the big winner in the Levant if things there go a certain way.