THE OUTBURST OF violence in the Great Mosque at Mecca is apparently over -- or almost so. There are rumors of gunmen still at large in the catacombs under the mosque, while above workmen rapidly clean up the blood and the damage of the building. But if this affair still seems minor in comparison with the events in Iran, it may well turn out to have a comparable impact on the world.

Saudi Arabia has little in the way of military forces. Its rulers maintain their wealth and their independence by a carefully devised series of political balances -- a system, you might say, of insurance policies. The great strategic danger is the Soviet Union to the north; the Saudis buy insurance from the United States with high production of oil at relatively low prices. Another danger is Arab nationalistic radicalism; there the insurance premium is financial support to the PLO. Still another danger is a religious orthodoxy that disapproves of modernization. The insurance premiums in that case are the ruling family's own traditionalism, its constant assertion of the Arab claim to Jerusalem and, notably, its protection of the holy places of the Moslems.

The armed assault on the Great Mosque is a direct challenge to the Saudi government and its right to rule. There could hardly be a greater mistake than to dismiss this incident as merely an isolated episode of obscurantist hysteria, which, with the restoration of order, is ended. On the contrary, it will suggest to the Saudi government that the forces of Moslem fundamentalism are stronger than they had thought, and the threat is greater than they had calculated.

G. William Miller, secretary of the Treasury, has doubtless discovered in his tour of the Persian Gulf that the present high levels of oil production have become a political target to a wide variety of factions and interests there. Mr. Miller's mission was to try to persuade his hosts to keep that production high. But reluctance is manifestly increasing. Heavy exports of oil are attacked from the political left as as bonanza to the oil companies and the West. The religious right considers that tide of oil revenues to be a peril to the established order. The technocrats argue that the oil is worth more in the ground than in the tankers. The conservationists speak of squandering the heritage of future generations. Mr. Miller's hosts gave him a lot of cautious answers and no promises. The reasons are not unrelated to that attack last week on the mosque.