Following the death of Lenin in January 1924, the Bolshevik Party was left without its Messiah. Trotsky, Lenin's brilliant accomplice and civil war hero, seemed the natural replacement. Yet, Stalin, an uninspirational bureaucrat labelled "too rude" by Lenin and as "the grey blur" by Trotsky had complete control of the party and government by 1929.
Lenin died leaving Stalin in a position of power. Revolutionary governments have no mechanism for promotion and so unmerited rises to power were possible. Stalin was lucky in this way. Stalin had obtained great power as the party General-Secretary, since he was the only link between the party and government he intimately knew the workings of both. More importantly, he was solely responsible for appointing and firing new members. These new members were answerable directly to him, and initially were bureaucrats who enjoyed the perks of the job, and so remained loyal to him. This gave Stalin immense power of patronage and so votes would consistently follow him. This power was further enhanced during the "Lenin Enrolment" (1924- 26) when the party bureaucracy gained 300,000 new members, all appointed by the Secretariat under Stalin's control. Thus by Lenin's death, and more so by 1926, Stalin had huge support and loyalty in the party.
The huge increase in the size of the Bolshevik Party also changed its character, from an elitist group off theorists, to a sprawling bureaucracy. After the Lenin Enrolment the majority of the party members were from the working and peasant classes. Stalin was quick to recognise this change and presented himself accordingly. He showed himself as the hard-working Georgian farmboy, the Old Bolshevik who had suffered exile in Siberia for his party, the man who truly understood the working classes. The party had changed from "the elite party of Lenin to the mass party of Stalin". .
Perhaps, had Trotsky wooed the Bolshevik bureaucrats he would have been more successful.