Amazon is an almost rationally priced stock at 30 times earnings. Bezos owns about 10% of Amazon which is valued at about 2T so there is his ~200B net worth.
Tesla is not a rationally priced stock, even with the recent drops, it's still selling at ~120 times earnings. At this point the odds of Tesla improving its earning by the factor of 4 needed to make its price reasonable seems unlikely at best. But enough people disagree with that assessment to keep the stock bid up to where it is. Musk owns ~400,000,000 shares of Tesla at ~$250 which is about $100 billion, and then he owns 40% of SpaceX. SpaceX is valued at $350B but it's not publicly traded so we don't get to know it's financials in much detail. The last thing I saw estimated SpaceX's revenue for 2024 as $13B (that's revenue, not profit), so a valuation of $350B is pretty rich there as well. But in any case, that adds ~$150B, and 'X' is supposed still worth ~40B. So that gets you to around $300B. Of course If Musk tried to cash out it would probably tank the value of either SpaceX or Tesla.
Bottom line is Musk has more net worth because more investors have believed/do believe he was going to generate, or at some point will generate, a whole lot of revenue that actually hasn't been generated yet.