The USSR was built around a class structure that went party member > Russian > non-Russian > Soviet State.
This was actually Stalin's doing, early Soviets not only espoused multi-culturalism, but in fact followed it. A disproportionate amount of Jews, Latvians, Georgians (off the top of my head) and others (probably) made surprising careers in the late 1910s - early 1920s.
This meant that the people in closet proximity to the party leader were the most benefited by society.
Aren't they always? Even in modern liberal democracies those close to the leadership enjoy unofficial perks, whereas in the early 20th century this was more or less expected. Those lacking perks want to change leadership and get them.
The soviets also controlled movement through their territories, in particular movement from the countryside to the cities was prohibited and required special approval. Information was tightly controlled. Its also worth noting that (for some reason) there was optimism and patriotic spirit in Russia about communism.
And yet early on the Soviet state
was plagued by rebellions.
if Stalin hadn't killed a quarter of his own military, put off modernizing it, and helped the Germans develop tanks (!).
Stalin didn't kill a quarter of the military (which, as all militaries do, primarily consisted of enlisted men,) nor even of the officer corps (absolute majority were merely fired, not killed.) One can theorize that the 5% that were killed were likely to be the best and brightest (they, so the theory goes, were reported by less qualified men passed over for promotion.) What Stalin did completely decimate was the high command- well over 75% (in the case of the navy almost 90%) were sentenced and either killed outright or sent into Gulags. This was a heavy blow for the military, but as late war experience shows, a temporary one.
Stalin was also modernizing the military with what can be described as too much zeal. By 1941 Soviet Union had over a million self-loading rifles (Germany hadn't adopted one yet, nor did the British) over 30 thousand tanks (many of which were on par with the German ones, perhaps unsurprising considering the wealth of shared know-how) over 8 thousand aircraft. What was missing, in a major way, was the doctrinal development to go along with these high-tech toys. Planes lacked pilots, tanks lacked drivers, complex rifles kept jamming on dirt, but because everyone was too afraid of showing initiative none of these problems were being solved. Instead Infantry was trained in human wave attacks and focred marches, like the ones employed in Brusilov Offensive 20 years earlier.
Tank know-how, as mentioned, went both ways.
Now, a very likely scenario is that if Stalin hadn't killed pretty much every other heir apparent to Lenin, and made an example of a few high ranking military officers, he would have been overthrown.
Yup. And those were exactly the people who suffered the hardest in the purges. Zhukov was in no way a less prominent figure than Tukachevky or Budenii, but he was one of Stalin's appointees (instead of Lenin's) and knew how his toast was buttered.