Think about buying a $1M rental property. One guy gets 9 friends together and they each put up $100k for 10% of the house. The house/business is worth $1m. The market cap is $1m.
Another guy wants to buy a $1m rental property but he goes to the bank and gets a $900k mortgage. The house is worth $1m but the market cap is only $100k.
Since tesla and GM raised money very differently their market caps are not comparable.
GM and Tesla are both public market stocks. Regardless of how they raised previous capital, the market is valuing Tesla higher.
That's because houses are quoted in total, not just the equity piece. Stocks are only the equity. (They could quote just the equity piece of houses. In that case it would be unhelpful to compare prices without checking the debt.)