Sunni dominated Saudi Arabia is facing a challenge in the Middle East from its Shia dominated neighbour. Both are engaged in rivalry for domination over the islamic countries in Middle East and Oil policy. Saudi Arabia though has a higher standard of living and larger oil reserves has a lower population. Iran has a lower standard of living due to its conflict with Iraq and US Sanctions.

Iran and saudi arabia map
Syrian Conflict

The Saudi Backing to Syrian Rebels working to overthrow the dictator Assad. The Iran, Russian alliance has been instrumental in helping Assad's forces to continue their reign. Russia has blocked UN Security Council sanctions against Syria.

The Western allies to want to intervene against the Dictator but Russia has continually blocked this. The Syrian region is Sunni dominant but with a Shia leadership. Hence Saudi is backing the Sunni rebels against the Shia forces of Assad which are supported by Iran.

This has lead to a proxy war between the two.

Yemen Conflict

Yemen is a muslim dominant state with Shia militia "Houthis" backed by the Iranian state and Yemen leadership backed by Saudi Arabia. Houthis had captured the Yemen capital and now had their parallel government running the Country. This had been a major embarrassment for Saudi Arabia.

Lebanon

This country has equal population of Shia and Sunnis. Here too the Shia dominated militia Hizbollah has managed to impose its leader as President of State.

Iraq

It is Shia majority country now with good ties with Iran. The Islamic state is engaged in war with Shia rebels [supported by Iran].

Embassy Attacks

Saudi Arabia closed diplomatic relations with Iran after its embassy in Iran was attacked. This was due to executions of Shia clerics by Saudi Arabia on accusations of spying for Iran.

Oil

The main source of income and power for Saudi Arabia was the export of oil. But with prices at all time low it can't sustain its proxy war and funding of rebels engaged in conflicts. Already the Saudi favoring countries like Eqypt and Lebanon have now looked towards Iran as their free shipment of oil was cancelled by Saudi.

It needs oil to be above $80 per barrel for breaking even. Hence it agreed with Iran to cut production to increase prices.

Iran meanwhile obtained a greater bargain by getting the OPEC to increase Iran's quota so that it could recover from the sanctions imposed by US.
American President elect Donald Trump has threatened both sides. Saudi Arabia now faces a challenge as JASTA a new law might be revived where American citizens might sue it for damages due to 9/11.

Trump also has threatened to reimpose sanctions on Iran due to its Nuclear program. This however even Saudi Arabia doesn't want.