There are a number of factors to keep in mind.
The first is that the Soviet government had a patron-client system, where senior officials could sponsor an underling's career opportunities in response for support for the sponsor in the lower level committees. One theory is that while Trotsky was off writing books about literature, Stalin was using his position as General Secretary to flood the lower level committees with his clients, thus ensuring that he essentially controlled the bureaucracy.
Another point worth making is that Stalin was able to get political control because a lot of people agreed with him. Keep in mind his background: Stalin was of poor Georgian descent. He came from the lower classes of society that Marxism was largely about. Trotsky, Lenin and others were intellectuals; most of the Bolsheviks were. A lot of emphasis is placed on how Stalin took over the leadership, but some of it should, I think, be recognized as him having more legitimacy in the eyes of many than other leaders.