WHEN THE Iranian revolution began two years ago, and Iranian oil exports fell, the world went into a convulsion. Economic growth came to a standstill. In the United States, gasoline lines formed and panic broke out. Oil costs doubled worldwide. A month ago, Iraq invaded Iran, and the war has shut off the flow of oil from both countries. But this time there has been no shortage, no panic and no significant effect on prices. Why?

The explanation is an interesting commentary on the changes that have taken place over those two years. People have begun to think differently about oil -- the people who run private households, as well as the people who run oil companies and governments.

In late 1978, when the strikes were gathering momentum in the Iranian oil fields, the international oil companies were letting their inventories run low. Oil was expensive, interest rates were up, and the cost of holding inventory was, by the standard of past experience, extremely high. By the time the companies realized their mistake, Iranian production had collapsed. The ensuing wild scramble for stock aggravated the shortage, and the unexpected disruption incited sellers to keep raising their prices.

It's now apparent that people have learned a great deal from that unpleasant experience. Oil companies, and large commercial users of oil, learned that holding large stocks is a great deal less expensive than not holding them. Governments learned to keep a watchful eye on those stocks and to see that they didn't fall again below safe levels.

Above all, people learned that they were going to have to get along with less oil. That much, at least, was beyond argument. The United States belatedly began to decontrol oil prices, and the rising prices sharply diminished oil imports. No one could have precisely predicted the Iraqi-Iranian war. But when it came, it fell well within the range of eruptions that the rest of the world knew to be likely in that part of the world. This time there was no surprise or panic.

The arithmetic is illuminating. The was has shut off a flow of about 3.5 million barrels of oil a day, most of it from Iraq. But there's been little effect on markets, and the first reason is that consumption worldwide has fallen. It's currently almost 3 million barrels a day less than it was a year ago. The second reason is that production is up in some areas other than the Middle East -- in the North Sea, and especially in Mexico. Some of the Persian Gulf exporters, led by Saudi Arabia, have volunteered to raise their production to cover any remaining shortfall.

The arithmetic means that the world can get along more or less indefinitely without the Iraqi and Iranian oil -- as long as no further disruptions occur. But it also means the war has eliminated the fairly comfortable margin of safety, in the balance between oil supply and demand, that had developed over the summer. The balance is, once again, a tenuous and vulnerable one.