Stalin, rather than Trotsky, succeeded Lenin because Stalin was the more adept politician and Stalin was better at doing the little things that allowed him to gather power to himself.
Trotsky seemed to have major advantages over Stalin. Trotsky was much more charismatic than Stalin was. This meant that Trotsky was better-known both inside and outside of Russia. But the problem was that Trotsky’s position was based largely on this charisma. He had not built himself a base of solid supporters within the party. Moreover, his great charisma meant that many people who were ambitious but who lacked charisma were jealous of him and willing to conspire against him.
Stalin was one of these. He was not charismatic but he was exceedingly good at playing the “inside game” of politics. He used his bureaucratic positions to build relationships and to get others in his debt. By doing this, he built a foundation that Trotsky did not have.
Using this foundation that he built with his political skills, Stalin was able to outmaneuver the more charismatic Trotsky and gain leadership of the Soviet Union.