This is what’s happening with Hamas. The Muslim Brotherhood's reasons are is not benign. It seeks to consolidate control over a highly populated country and fundamentally transform it into a Sharia state under the Brotherhood's perpetual rule. Hamas, however, by its nature, cannot accept Islamism in one country (to paraphrase Stalin). [Note below] Hamas isn't interested in building up a Sharia state in the Gaza Strip as its main goal because it seeks to conquer Israel and the West Bank.
Another factor cited is the need to fulfill Egypt's obligation under the ceasefire agreement it helped broker between Israel and Hamas. U.S. pressure to keep this pledge was an incentive. This is to the credit of the Obama Administration.
For the time being, however, the situation looks better.
Note: The phrase "Communism in one country" meant that having Communism in one country--the Soviet Union--was enough for Communists and they would not try to spread revolution further. Communsts were supposed to reject this idea. The meaning here is that Hamas would be happy enough to run the Gaza Strip that it wouldn't be aggressive or subversive to spread its rule further. I'm saying that isn't true. The same applies for the Muslim Brotherhood generally. How much patience or risk-taking they employ is another matter.