First, his Gigafactory to produce batteries. When the other big automakers get into the electric car mindset, who are they going to buy batteries from? Musk who owns the single largest and high-tech battery factory (that produces on an enormous scale), or other battery producers who have less economies of scale and higher prices? Obviously, lower prices win and Musk ends up selling batteries to his competitors...genius.
Second, when other manufacturers get into the electric car game they are going to need nationwide chargers. Did you think that the Tesla and Supercharger of proprietary connectors for no reason? Since Tesla will have a huge nationwide system before anyone else, Musk will license the rights to use his chargers. Again, making money from the competition. Competitors will not have the ability to compete on charging when they release cars because Tesla will already have an established network.
As for SpaceX...thats a whole another post for another day.