In an attack on Camp Taji airbase in Iraq, Iran has shown it’s desperation. Currently the Theocracy is facing internal strife, economic pressure from sanctions and the results of the Covid-19 virus. The latter two problems are probably exacerbating the first. To the leadership of Iran attacking the United States is the answer to their problems.
The strategy is not unique to Iran; North Korea and Hamas do the same thing. The attack is designed to provoke a military response or at least some saber rattling from the attacked nation. In this case the US. The idea is their populace will become fearful of an imminent attack.
One effect of this fear is the populace will tend to forget the recent events that inspired anger against their own regime. This bait and switch tactic would help quell the protests.
Another effect is most of the population will rally with their government against a common threat. Most people are political centrists. The people are influenced by those on opposing ends of the political spectrum depending on the current circumstances. In the case of fear of outside forces the loyalist cause will win out, turning the political tide in favor of the government. Those who aren’t “loyal” are quickly labelled as unpatriotic and dismissed or even attacked. The anti government protests would vanish.
By hitting the Iranian backed militia in Iraq the US has been able to demonstrate determination but hopefully not instill fear in the citizens of Iran that are protesting their government. The Iranian government can feed those fears with propaganda of course. Over reacting to these events is detrimental to the long term interests we have in the region. At the same time we cannot project weakness that could encourage more attacks against our troops.