Stalin wanted to concentrate on communism in just one country - Russia. Trotsky wanted Russia to be the focus for the spread of World Communism but the Russian people thought it would be better to sort out their country first before concentrating on any others.
Trotsky was the most obvious successor after Lenin. He was the best known of the communist leaders after Lenin. He was extremely able as he had organised the Bolshevik takeover and saved the entire Bolshevik government. He had a reputation outside the Soviet Union and was well known across Russia. Despite all this, he never really had a good chance to take over Russia, or gain many supporters because the other communist leaders disliked him and were determined to prevent him becoming the Russian leader. They found him arrogant, which stemmed from his upbringing, and they suspected his cleverness. This was a bad thing for Trotsky because people didn't trust him, as they knew he could plan things wisely. People and the government mistrusted him for not joining the Bolsheviks until 1917.
Stalin had no outstanding achievements like Trotsky, but he did distinguish himself in the civil war. Lenin had also become concerned by Stalin's ambition and his relationship with Stalin deteriorated rapidly. In his will, Lenin warned that Stalin had concentrated enormous power in his hands. Other politicians ignored this as it was never really published, and they called Stalin a 'grey blur' because they thought he was of no importance, and Trotsky didn't see him as a threat. Leaders were so busy in their efforts to keep Trotsky out and they preferred Stalin's belief in socialism in one country.
At Lenin's funeral, although is wife wanted a small gathering, Stalin saw a chance and took it. He had Lenin embalmed and made the funeral a big event. He looked like a hero and seemed to be Lenin's best friend. Unfortunately for Trotsky he was ill and also on holiday for the funeral and so was absent, while Stalin stole the limelight. Once again, Stalin took another chance that he saw. He phoned Trotsky to tell him that he wouldn't get back in time for the funeral, which he lied was a day earlier than planned, and that Trotsky shouldn't bother to make it. In fact, Trotsky could make it if he tried, but Stalin wanted to keep him away. Stalin had manipulated the situation.
Stalin was an extremely clever politician. He used propaganda to get people to vote for him. He even got enemies to vote for him. He planned his bid for power carefully and he made great efforts to associate himself with Lenin wherever possible and got off to an excellent start at Lenin's funeral. He was also extremely clever in using his power within the communist party. Stalin took on boring yet important jobs in the government, which caused other leaders to call him a 'filling Clarke with virtually no significance'. Whilst doing these jobs, he used his position to put his own supporters into important posts and even transferred supporters of his opponents to remote postings.
Stalin listened carefully to speeches by Lenin and other politicians and quoted back phrases. He twisted them round to make him seem better, and people believed him. This was another way that he manipulated situations.
Therefore I believe that through clever propaganda and key events like Lenin's funeral Stalin rapidly gained supporters, and overtook Trotsky in the bid for ruler of Russia.