There is a long, tangled, and disputed back history to all this. Georgia, like the former Yugoslavia, is an ethnic patchwork. The native Abkhazians are largely Muslim. The South Ossetians want to unite with their ethnic relations over the Russian border in North Ossetia. Neither liked being in Georgia, and as the Soviet Union broke up, both made a bid for independence. In an ironic parallel, the Georgians closed down the local university in the Abkhazian capital of Sukhumi just as the Serbs were closing down the Albanian university in Kosovo, on the grounds, one very distinguished Georgian philosopher said, that the Abkhazians had no proper language, history or culture, and did not need a university anyway.
Georgia's first democratically elected president, the disastrous Zviad Gamsakhurdia, then launched a vicious little war against Abkhazia, smashing its capital Sukhumi. But the Georgians were defeated by a combination of Abkhazians and "volunteers" from Russia and Chechnya. Tens of thousands of Georgian refugees fled to Tblisi. Much the same, though on a smaller scale, was happening in South Ossetia.
Various ceasefires were brokered, with Russian "peacekeepers" acting as guarantors. The ceasefires regularly broke down, thanks to provocations and intrigues by all sides. They were as regularly patched up again.
With the arrival of Mikheil Saakashvili, another democratically elected president, things began to go downhill. The Americans gave him political and economic support and advice, and equipped and trained his army. He turned out to be the Sorcerer's Apprentice, and outran American control. He provoked the Russians and the South Ossetians by one pinprick after another, and, above all, by his application to join Nato.
The Russians regularly warned that there would be consequences. Egged on by the Russians, the South Ossetians increased their provocations. Perhaps it was a deliberate trap. If so, Saakashvili fell right into it. His soldiers had no hope of beating the Russians in a fight. Maybe he assumed that the West would bail him out: an epic miscalculation. Many Georgians now feel that the West betrayed them. In due course they will no doubt turn on Saakashvili himself.