That's not how it works. GM issuing shares tomorrow to raise cash, would not inherently boost the market cap. In fact, more likely given the context, shareholders would punish GM and push their valuation down. Shareholders would be spooked by such a move, they'd regard it as a bad sign for GM's operating picture. TSLA & GM are not being treated the same, or valued on the same basis. It's almost identical to the Walmart vs Amazon scenario in that sense.
Cash is essentially never valued at a $1 to $1 basis in terms of representation in the market cap. It's discounted, as for numerous reasons it's not (and shouldn't be) worth 1 to 1 in practical terms.
Debt is also frequently treated very differently from one company to another depending on the context. Comcast for example, has negative $59 billion in net tangible assets, and a mere $4 billion in cash (and most of their 'assets' are goodwill & intangibles); they have a terrible balance sheet. Yet their market cap is $181 billion, to go with $8 billion in net income. Shareholders, for various reasons, are giving Comcast a very sizable multiple and mostly ignoring the balance sheet (ie they don't regard it as a serious threat). GM has a vastly superior balance sheet, six times the cash, routinely ~50% higher quarterly net income, and yet is worth 1/3 what Comcast is.