Historically, the country's territories were part of the traditional lands of the Georgians, unlike Abkhazia, which not only have an indigenous population but also polity as well. In fact, South Ossetia was carved as an independent polity only in 1921, after the Soviet Union's invasion and subsequent annexation of Georgia, and even then only as an Autonomous Oblast. What's even more unsettling to the Georgians is that the Soviet Union carved South Ossetia from bits of many divisions instead of a single one, and many of them never have a history of being settled by Ossetians either.
As for the titular people themselves, the Ossetians were descendants of the nomadic Sarmatians, a part of the Eastern Iranian confederation who once conquered the entirety of Central Asia and Eastern Europe before the arrival of the Mongols, the Turks, and the Slavs; their language is related the closest to Pashto, of all things. While they have been inhabiting the Caucasus area for a while, they only started to migrate south of the mountains in the 17th century, and only on a large-scale basis in the following centuries.
In the years preceding The Great Politics Mess-Up, ethnic tensions began to flare up in Georgian regions containing minorities, including South Ossetia, Abkhazia, and Samtskhe-Javakheti. The Ossetians wanted Georgia to upgrade their region's status into an Autonomous Soviet Socialist Republic, on par with their northern neighbor, the North Ossetian ASSR. Their request was instead met by the opposite: the demotion of their status into a mere administrative region. War ensued, but all authorities involved were able to draft a ceasefire and peaceful settlement in granting more devolved powers, preventing South Ossetia from seceding.
The years up to 2004 were generally peaceful, until Georgia electeed the very nationalistic Mikheil Saakashvili as president. Saakashvili fought to reunite all Georgian lands once and for all and began a campaign of forced reunification, by violence if necessary. Tensions again flared up and the relationship between the ethnic groups were never the same again. Four years afterward, after a back-and-forth clashes perpetuated by both sides, Georgia went into a more active phase by trashing the regional capital Tskhinvali, killing several Russian peacekeepers along the way. This was the last straw in the eyes of the Russian government, who then entered into a full-scale war with Georgia. Several artillery and gunfights later, Russia won and detached both South Ossetia and what's left of their ownership of Abkhazia from Georgia, granted them recognition, and began processes than would make them Russian citizens-lite. Meanwhile, Georgia formed provisional governments for their breakaway regions that the international world recognizes as the legal administrators.
Sovereignty might not has been kind to South Ossetia though. The Ossetian government had initiated a campaign of ethnic cleansing of Georgians and forced them to move to Georgia, but the Ossetians themselves also had to migrate in search for safety, primarily to their North Ossetia-Alania brethren, which means that now South Ossetia is in danger of underpopulation. There's also the fact that because only a handful of nations recognize them, they can't make partnerships with anyone and thus many people become homeless and unemployed. Not to mention that excessive aid on Russia has created an unhealthily dependent society.
The South Ossetian Flag