There were two main types of factors that prevented Trotsky from becoming the leader of the Soviet Union after Lenin’s death. Some of these were factors internal to Trotsky while others had to do with the competition, particularly from Stalin, that Trotsky faced.
Part of the problem was with Trotsky himself. Trotsky was a great writer and speaker. He had the ability to inspire people. If the USSR had been more democratic, he would likely have defeated Stalin in elections. But Trotsky was not so good on the personal level. He could come across as very arrogant. He did not cultivate personal relationships well. This meant that he was not good at building up the sorts of networks of cronies that was necessary to gain power in the Soviet system.
Part of the problem was that Trotsky faced Stalin, who was great in the ways that Trotsky was flawed. Stalin was an expert at doing the little things to build personal support. Since the Soviet Union was not democratic, his ability to build these relationships was more important than Trotsky’s ability to speak and write and inspire.
Trotsky lost, then, largely because his skill set was wrong for the system he was in while his opponent’s skill set was just right.