Four months ago, Egyptian police arrested 25 Islamic terrorist suspects, and is seeking 24 others. Some of these have fled the country, but others are believed hiding in the Sinai desert. Egypt is putting the people it arrested on trail. Considering the large quantities of weapons, documents and bomb making material captured with some of the suspects, these guys are headed for some long prison terms.
All of these terrorists were working for Hezbollah in Lebanon. Iran, in turn, had asked Hezbollah (which it created in the 1980s, and continues to arm and finance) to get some terrorist action going in Egypt. This plan did not remain secret for long.
Egypt was supplied with valuable information about this network by intel agencies in the United States, Britain, Germany and Israel. Especially Israel, which keeps a close eye on Hezbollah. Iran has been putting more intelligence (and counter-intelligence) people into Lebanon, and has been catching more Israeli agents. Or, it may be that Israel is pushing its Lebanese agents more to find out what Hezbollah is up to. That puts agents at risk, but Israel knows the Iranians are bearing down, and may soon have nuclear weapons.
Iran has shifted its terrorism efforts from Iraq (where efforts failed) and Afghanistan (where backing the anti-Shia Taliban was unpopular in Iran) to Israel and Egypt. Why Egypt? Because it, along with Saudi Arabia, is one of the major Sunni Arab countries opposing Iran, Iranian nuclear weapons programs, and Iranian plans to become the leader of the Islamic world, and spread the minority (about 10 percent) Shia form of Islam, at the expense of the majority (over 80 percent) Sunni form.
Iran isn't as vocal about this as it would like to be, because they also believe all Moslems should be united in their opposition to Israel even existing, and the Christian West in general. This view is not shared by many Moslems, and Iran knows it. But being true believers, the militants who control Iranian diplomacy and special operations, consider terrorist attacks against Israel (a hard target) and Egypt (a much easier target) a suitable consolation prize.
Egypt does not like being on the receiving end of this kind of attention, and doesn't like being beholden to Israel either. But what can you do? The Iranian plot apparently included sinking a large ship in the Suez canal, thus depriving Egypt of a major source of income for many months. It's like bombing a nations oil wells, but without the spectacular visuals. Other targets were to be the Israeli ambassador (which would not bother most Egyptians much) and foreign tourists (which would bother many Egyptians a lot.)
Big, disorganized and vulnerable Egypt has become a major Iranian target. And any Egyptians who tried to ignore this, got a reality check with the April arrests, and the continuing manhunt. Egyptians also have to get their heads around the fact that Israel and many Arab states are allies in their jihad against non-Arab Iran.