Historians will debate endlessly the question of whether martial law was inevitable in Poland or could have been prevented. Could the Polish experiment of combining democratic institutions with Communist Party rule possibly have worked out, or was it doomed from the very start?

With hindsight, the events of the past two weeks have a ghastly inevitability to them.

As the room for maneuver by the Polish premier, Gen. Wojciech Jaruzelski, became more limited, reconciling the demands of Solidarity with the relentless pressures of the Kremlin proved impossible for him.

"In the end it boiled down to a question of the survival of the ruling group. If they had taken any other course of action, they feared, they would have been swept away," a Polish journalist remarked.

Now, after the fact, Poles and Western analysts debate two theories to explain the rise and fall of Solidarity.

One holds that the Kremlin, in common with hard-liners in the Polish leadership, never reconciled itself to independent unions in a one-party state. From the start, Moscow was determined to break Solidarity--and any hesitation merely reflected tactical differences.

The second, more elaborate theory holds that, based on history, the Soviet Union was prepared to accept a certain amount of Polish deviation. An independent church and an independent peasantry already existed, and independent unions might also have been acceptable had they not challenged the Communist Party's monopoly of political power.

"A real chance did exist in Poland to create a pluralist system based on socialism," commented a member of the parliament. "It was a chance that was lost because Solidarity's appetite became too great, and the party leadership lacked sufficient imagination to think up new forms of political structures."

Proponents of both theories agree that the plans for martial law were laid many months in advance. This is proved by the detail contained in the martial law decrees presented to the State Council early Dec. 13, and by the inclusion in the published lists of detainees of names of people who left Poland months ago.

In private, senior government officials confirmed that contingency plans for a state of emergency were drawn up as early as March during the crisis over alleged police violence against Solidarity activists in the northern city of Bydgoszcz.

Also at about this time the Soviet Union apparently decided that an all-out invasion of Poland would be too costly--in terms of both human life and Western reaction--and that the best hope of restoring its hegemony lay in pressing the leadership of the Polish Communist Party.

In the next months, Polish sources have said, Moscow combined diplomatic, economic and military threats to bring the Poles back into line.

A key figure was the Soviet commander-in-chief of the Warsaw Pact forces, Marshal Viktor Kulikov, who visited Warsaw at least a dozen times.

There were other visitors. The Soviet planning chief, Nikolai Baibakov, is reliably reported to have threatened in September to reduce oil supplies sharply unless the Polish party reestablished supremacy over Solidarity.

"Just see if the West helps you out," he is said to have jeered.

As far as can be judged from outside, the Polish party leadership appeared to be developing two lines of policy. On the one hand, it declared its continuing commitment to resolving the crisis peacefully through negotiation with Solidarity.

At the same time, preparations were quietly proceeding for martial law in case these methods failed to contain Solidarity as a rival political force.

At a Central Committee meeting in June, before the party congress, a hard-liner advocated a basic change in strategy from "resolving the crisis by peaceful means and by our own forces" to "resolving the crisis by our own forces at all costs."

The proposal, outlined by Zygmunt Najdowki, the party chief in the northern town of Torun, was voted down by the Central Committee, which endorsed the moderate leadership of Stanislaw Kania. But it significantly marked the first public recognition by a party leader of readiness to use the Army and police against Solidarity.

The influence of the moderates was steadily undercut as Soviet pressure increased and Solidarity started pushing against the limits it had accepted for itself in August 1980: recognition of the leading role of the Polish Communist Party and Poland's continued allegiance to the Soviet Bloc.

A senior official commented: "Solidarity lost because its leaders had two fatal illusions. First, they believed that the party leadership was so totally demoralized that it was unable to defend itself at all. Second, they thought that they could do a direct deal with the Soviet Union--that the Kremlin would accept their guarantees. This overconfidence led to their downfall."

Another senior member of the Polish establishment opposed to the imposition of martial law agreed that Solidarity must share the blame. But he accused Jaruzelski of lacking the imagination to devise new methods of power-sharing with the union.

Had the Polish leadership stood firm, he argued, the Kremlin would have been faced with this stark choice: to accept a solution worked out in Poland as a fait accompli or risk war. He said he believed that Moscow's leaders would have judged the costs of all-out confrontation as too great.

The crucial turning point in the drama appears to have been the meeting of Solidarity's presidium at Radom Dec. 3, after security forces broke up an occupation by fire fighter trainees of their college in central Warsaw. The Solidarity leadership threatened a general strike in an attempt to head off passage in parliament of measures granting the government emergency powers.

Marshal Kulikov arrived in Warsaw shortly after the Radom meeting, and the decisive phrase of preparations for martial law went ahead. The Politburo met early in the week and, according to informed Polish sources, accepted a formula giving Jaruzelski the political go-ahead to use force against Solidarity if he judged negotiation impossible.

With this authorization, Jaruzelski waited for the weekend when the full Solidarity leadership was meeting in Gdansk. The first day of the meeting confirmed his impressions from Radom, and the Army and riot police were ordered out of their barracks. The machinery of martial law was then impossible to halt.