I mean it can be both (broadly speaking). NATO loves expanding and broadening the strength of its alliance, weakening a geopolitical enemy, opening up new markets for their shiny shiny weapons, and provoking a little low-level conflict to keep everyone alert and stay on top of new tactical developments now that the landscape of war is changing.
But also, holding Russia at bay is a necessary noble thing to do, and all these breakaway republics are acting out of pure self preservation necessity when they join an alliance that will bloody Russia's nose for them if they get messed with.
All Russia had to do was join NATO and stop claiming the former Soviet Union has to be restored. NATO exists because Russia was considered a threat. Were it not a threat, its entire existence would be futile.
NATO was on the decline in the last decade. There were many articles asking if it was just a cold war holdover and many countries weren't paying their fair share. Then Russia invaded Ukraine, starting the largest war in Europe since WWII, and suddenly new countries are joining NATO and members are increasingly paying their 2%.
Putin asked about it again when he came to power, he just didn’t want to wait in line or meet the prerequisites like the “countries that don’t matter” did
Russia is testing if NATO is indeed an anti-Russia alliance. It may well be, although Russians culturally distinguish themselves from the West and would never align with the latter. Even after the fall of the Soviet Union, Mikhail Gorbachev, the man responsible for the collapse of communism, still expressed concerns about NATO expansion. Russia even set up CSTO, as something of a counter to NATO, with several former Soviet republics. So, this clearly shows Russia wants to be independent from the West and carve their own influence; that ideology being called Eurasianist.
Keep in mind though that the West and Putin were friendly in the 00s but the former keep questioning the human rights issue in Russia. So, I think this annoyed Putin (as many dictators tend to be when questioned about human rights) and only galvanised his and Russia's anti-Western sentiment. There are many Russians who are pro-West and liberal, but they are a minority in comparison to the nationalist and Eurasianist minded Russian population. Because if Putin truly doesn't have support, the support for the Russian invasion of Ukraine would have already collapsed.
I find the term "Breakaway Republic" rather problematic. Most of the countries that used to be in the Warsaw Pact or USSR were independent before World War II. They did not just break away, they re-established their independence.