Events have conspired to overload the political system in the Mideast. From Iran at the Asian edge of the area to Algeria on the West, every government is under heavy pressure to resolve internal contradictions.

A diplomatic realignment - the third in the last five years - is a near certainty. Whether the transition can be accomplished without a political cataclysm is not so clear.

The seeds of the present trouble were planted by the huge rise in oil prices that took place almost overnight just five years ago. Gods, perhaps, could have figured out fair and honest ways to spread about the unearned hundreds of billions of dollars that suddenly came flooding in upon the oil-exporting states.

Humans did not. In almost every one of the newly rich oil countries there has been a truly bad distribution of revenues - headlong development leading to social dislocations, rampant inflation, grossly unequal rewards and corruption on a grand scale.

The strikes, riots and protests now working against the shah of Iran are only the biggest and most dramatic example of the social backlash occasioned by the sudden access of new wealth after 1973. Saudi Arabia, Kuwait and the smaller states of the Persian Gulf face the same troubles if they are not careful.

Iraq, Libya and Algeria have been able to avoid the trouble only by a kind of radical put-on. While doing business like crazy with the capitalist world, their leaders have pretended to be super-radicals in political matters. Because all three countries are relatively isolated, they have been able to get away with the pull-out. But even that act cannot go on forever.

Especially since the rising importance of the oil-exporting states has a critical impact upon Israel. The Israelis, badly scared by the 1973 war with Egypt and Syria, panicked themselves into believing that their chief ally, the United States, would sacrifice them to its interest in ensured supplies of Arab oil.

Partly as a result, the Israelis elected, in the spring of 1977, a hard-line government under Prime Minister Menachem Begin. Begin came to office determined to show that Israel could fend for itself even without the total backing of Washington.

To that end he initiated - chiefly through secret meetings in Morocco in September 1977 - moves for a separate peace with Egypt. Those moves bore fruit in Anwar Sadat's visit to Jerusalem last November. The Jerusalem visit led directly to the Camp David accords between Israel and Egypt.

The prospect of peace between Egypt and Israel turns the screw on every Arab government. Those, who prided themselves on their toughness toward Israel now have to prove their mettle. That is why the Iraqis, Syrians and Palestine Liberation Organization called an anti-Sadat summit meeting in Baghdad.

More moderate governments with connections to Egypt - especially those with oil to export - at least had to prove that they were not going to sell out the Palestinians. That is why Jordan, Saudi Arabia and the sheikdoms of the Persian Gulf sent officials to Baghdad.

Inevitably there follows some realignment in the Arab world. The highly vulnerable moderate states now have to take their distances from Egypt and stand a little closer to the Palestinians. The extreme radicals - Iraq, Libya, Algeria and parts of the PLO - have to curb their rhetoric to make their charges of an Egyptian sellout more appealing to the outside world.

Here in Egypt, Sadat has to adjust his regime away from cooperation with Saudi Arabia and toward cooperation with Israel and the United States. That explains his recent shifts in the cabinet, the army and the structure of Egypt's political parties.

Perhaps it will be possible for all the governments involved to make the required adjustments without falling from power. But the transition is bound to be delicate. In any case, the Mideast is entering a testing time of extreme tension. Anybody who raises the pressures higher is playing with fire.