Stalin began to build his support base long before Lenin’s death

Stalin became General Secretary in 1922, and used his powers and influence to gather information.

Above all, Stalin recognized that power laid in the Politburo.  As the party developed into various organs for administrating the state, it was the party structure that grew power, due to their increased scope of responsibilities.  At the top of this structure was the General Secretary, and Stalin.

In this position, he had access to personal information of party members, the head of the secret police reports to him regularly, and he also had the power to appoint people to party positions.

All this means Stalin could outvote and outmaneuver his opponents.

Stalin also launched the Lenin Enrollment between 1923-1925, which encouraged industrial workers to join the party.

This caused a influx of 500,000 party members.

These new members were politically naive, however, and they merely saw their enrollment as a source of benefits and employment.  Thus, they owed this all to the person who recruited them, which is Stalin.

Stalin was always careful to identity with the needs and demands of these new members.