Chess analogies are overdone, but chess is a good way to explain the narrative fallacy--the tendency of humans to be able to explain things in hindsight much better than understand them as they unfold. So I'll explain in hindsight how two current events led to our bombing Iran:
Trying to invade and hold Iran is a fool's errand. OK, so was bombing Iran, but it seems that the we didn't understand that at the time. Rather, we opted for a strategy of bombing key sites, and holding and occupying a few other key areas (Khuzestan, Bandar-e-Abbas, etc.), without attempting to occupy the entire country. In order to do that, we needed to address a force problem: all of our ground forces were tied up on the ground in Iraq. Specifically, the US Marines, the force most capable of larger expeditionary actions, was spread thin in a counter insurgency and peacekeeping role. We needed to make a significant chunk of Marine Corps manpower available for use against Iran. The problem was that the American people (before that rather effective PR blitz and those statements by Hillary) were quite opposed to attacking Iran. We couldn't just pull back an entire expeditionary force into a staging area in some Gulf Emirate airbase without raising several red flags. And anything originating out of the Vice President's office would look suspect, as well. BUT, if we got the Commandant of the Marine Corps to say that the Marines are meant to operate in an expeditionary role, and that they should leave Iraq and go to Afghanistan, that would have exactly the same effect, but seem quite legitimate. Suddenly, the Marines would be nicely staged for aerial redeployment within theater when they would be unexpectedly re-tasked (from their trans-shipment point conveniently near Bandar-e-Abbas) before they were actually spread thin on the ground in Afghanistan. It's easy to explain these kind of set-up moves on the chess board eight moves later, but understanding how today's move is intended to set up an attack eight moves down the road is much more difficult.
Of course, we needed more than just ready-to-deploy Marines. There was that sticky issue of American public opinion that was, at the time, against attacking Iran. Discussions of their nuclear ambitions were too speculative after the WMD debacle, we needed something more tangible. We had been issuing press releases to everyone who would listen that Iran was supplying the weaponry used by Shi'a insurgents against our forces in Iraq for months, but it really hadn't galvanized American behind attacking Iran. However, sometimes your enemy is your friend. The insurgency in Iraq had been operating under a model of open-source innovation for quite some time. They had tried many indirect fire attacks against US bases with mortars and rockets, and on occasion had minor success. It was natural to expect them to learn and improve over time. But this time, their tactical improvements (combined with a re-entry of certain Shi'a militias into a more active role) allowed us to point the finger at Iran. Beginning with the relatively minor but accurate attack on Camp Victory that killed 2 and injured 40, and escalating into the string of more deadly attacks that followed, we were able to spin this increase in accuracy to point the finger not at the expected improvements of an open-source enemy, but as a result of training and improved guidance systems and munitions provided directly by Iran. It was surprising, even to the most cynical among us, how quickly the American people rallied around the flag.
The rest, as the saying goes, is history...