I don't know the terms. I'm assuming that this is a new issuance at the current market price and thus would effectively provide $20 million of additional liquidity to counteract the cost of the settlement.
Assuming he is buying newly-issued shares from Tesla, then the money goes directly into their treasury. So, the company will have $20MM more in cash than it did the day before.
I'm no finance person, lawyer, or anything like that. But I suspect that he can't just give Tesla money and it has to be in exchange for something, such as stock.
If it's newly issued the price will be dilution of the other shareholders stock. I guess it's a smallest burden on Elon and the rest of the shareholders.
I meant "covering" in the context of the parent commenter's concern about cash flow. He's not donating the money to Tesla, but he's preventing the fine from making their cash flow worse.
The details will surely be disclosed.