ISIL's sweep across huge areas of Iraq in June may have shocked the outside world, but in Iraq it merely confirmed what many knew - that this offensive was a long time coming. 

The shock in the US and Europe is easy to explain - a rebel group taking control of a major city like Mosul doesn't happen every day.

Iraqis however had been warning about such a threat for a year. And there was familiarity to the places that fell first: Mosul prison was attacked and Sunni prisoners jailed for fighting the Shia-dominated government were released. In other areas such as Tikrit, Sunni rebels took control with little or no Iraqi army response.  

ISIL and the Sunni rebels came together to make a formidable partnership that used the Sunnis' local knowledge and the huge military resources of ISIL to great effect.

According to Iskander Witwit, a former deputy head of Iraq's parliamentary defence and security committee, ISIL offered Sunni tribes a way to fight back against marginalisation.

"ISIL promised them protection from a Shia-led government. ISIL effectively brainwashed many of the Sunni groups by claiming to fight in the way of God. That was particularly attractive to Sunni youth: that my enemy's enemy is my friend and that united with ISIL they would stand, but divided they would fall." 

But it became clear in the early days of the ISIL sweep that there was a disconnect between the groups. An ideological gap soon developed.

On July 21 one of the main Sunni groups, the Naqshbandi, issued a statement that was important for what it didn't say. It didn't name or pledge allegiance to ISIL, and instead focused on a list of ideals the group stood for: it condemned attacks on religious minorities, and set itself up as a national resistance movement.

In contrast, ISIL fought to establish a transnational Islamic state, or "caliphate", with little regard for the nationalism of the Sunni rebels. 

Statements from other Sunni groups followed. ISIL were never referred to by name and many began to wonder about the exact nature of the relationship between ISIL and the Sunni rebels. Then the statements semingly stopped appearing. The last one seems to have been issued on August 24.  

Through information gathered from contacts with Sunni rebels and ISIL, it appears that a deal was struck in September aimed at reconciliation.

In Anbar, Salaheddin and Diyala provinces the main rebel groups - the Naqshbandi, the Mujahedeen army, the Rashedoun army , Ansar al-Islam and Ansar al-Sunnah - have pledged allegiance to ISIL and are being supplied with weaponry, equipment and money by ISIL.

In return the rebel groups are in a defensive position in the areas they control.

The rebels have pledged not fight on the offensive against the Iraqi army or Kurdish peshmerga forces. That is ISIL's responsibility.

That goes a long way to explain why the rebel groups have been so quiet of late, but also trumpets the disconnect between them and ISIL. 

A defensive position works well for the rebels, many of whom would fight to kick out ISIL in return for a greater role in Iraq.

A lot of the groups struck alliances with ISIL because it has money, weapons and the will to fight. It's a marriage of convience for all, but not a marriage built on love for what ISIL stands for, and therefore doomed for divorce.

Pro-government Sunni forces know this and say they want to bring all of the Sunni factions to the table in order to build a broad anti-ISIL Sunni movement.

One of the main leaders of a pro-government Sunni tribes, Shiekh Ahmed Jughaifi, told Al Jazeera the rebel groups could help turn the tide.

"I believe if the Sunni rebels wake up and realise the true threat of ISIL ... there will be a chance to redeem themselves by joining a genuine national reconciliation agreement.

"If the government embraces these Sunni factions and complies to their demands ... then we might consider the possibility for those factions to join us with the security forces and help us against our war with ISIL."

A broad Sunni coalition against ISIL would be a formidable foe but there are many obstacles before that can happen. The Iraqi government, for one, is not ready to involve them.

Given their current, albeit fragile, allegiance with ISIL, getting the Sunni rebels to switch sides will be a challenge.

Nonetheless if there is real political will and comprises from the Shia-led government, then the scenario remains a possibility.

That's perhaps one of the reasons the Sunni rebels have gone quiet of late. 

Follow Imran Khan on Twitter @ajimran.