The last few years of Lenin's life were marred by illness. The Soviet dictator had suffered a series of debilitating strokes, which made it impossible for him to discharge his duties. Thoughts inevitably turned to the succession, and a number of very senior figures in the upper echelons of the Communist Party jockeyed for position so that they would be perfectly placed to take over from Lenin when he passed away.
One such figure was Stalin. Over the years, he'd built a large and growing power-base within the Secretariat, the body charged with responsibility for administering the Party. In his position as General-Secretary, Stalin had amassed enormous power, which he used to control many of the crucial organs of the Soviet state. Among other things, this meant that he could exert considerable patronage, promoting younger members of the Party to key positions that would bolster his support when the time came for him to take over.
Lenin, in his final testament, sharply criticized Stalin and called for his removal as General-Secretary. This was a clear acknowledgment that Stalin had concentrated too much power in his hands and would abuse that power if he was allowed to continue in his present role.
Yet after Lenin's death, Stalin was able to ensure that his testament did not gain a wide audience, even among Party members. He was also able to outmaneuver his opponents in the Communist Party and take the reins of power. Once established as the undisputed ruler of the Soviet Union, Stalin then systematically set about destroying his rivals for power, such as Kamenev, Bukharin, Zinoviev, and Trotsky. With all his enemies wiped out, Stalin was now absolute ruler of the USSR, and would remain so until his death in 1953.