According to the Carnegie Endowment for International Peace, Iran and Saudi Arabia have historically entertained an antagonistic relationship, particularly after the Iranian Revolution in 1979. An ideologically driven, revolutionary Iran was viewed as dangerous by Saudi Arabia. Iran is a Persian state whilst Saudi Arabia is Arab. Moreover, during the Iran-Iraq war of the 1980s, Saudi Arabia supported Iraq financially, and it significantly increased oil production to maintain some degree of stability in international markets, which further increased the rift between Iran and Saudi Arabia, as the increased production brought prices down, limiting income to Iran from sales of its oil.  However, the linchpin that held the two large and powerful states peacefully together is their membership of OPEC. Both have been members of OPEC since the 1960s. Saudi Arabia is the biggest producer of oil and Iran dropped back into third place- behind Iraq- in July 2012 after over 12 years as the second biggest producer. 
Impact of Sanctions Against Iran
With the application of sanctions against Iran in January 2012 in a Western effort to halt the development of Iran’s nuclear capability, Saudi Arabia stepped up to replace the fall in output. It offered to maintain supply to prevent a sharp rise in prices in a volatile world market. Iran warned other Gulf/OPEC states not to increase their output to stabilize world prices, threatening retaliation. In March 2012, the kingdom of Saudi Arabia announced that it wanted to address the ‘negative impact of rising oil prices on the world economy’ and made available supplies of crude to meet any demand.  In turn, Iran’s market share depleted and the state of its economy worsened.
According to the Petroleum Economist, adding a new dimension to the tensions between Iran and Saudi Arabia was an emerging working partnership within OPEC, between Iran and Iraq under the government of Prime Minister Nouri al-Maliki.