In January 2018, Elon Musk needed $100 million. Instead of calling a bank, he turned to SpaceX, the rocket company he founded and where he serves as CEO. Over the next three years, Musk borrowed a total of $500 million from his company. The loan terms were significantly lower than what most banks offered, with an interest rate that fluctuated from less than 1% to nearly 3%, according to internal SpaceX documents obtained by The New York Times. The documents did not say how Musk planned to use the money, which he paid back to SpaceX by the end of 2021. The loans and their exceptionally kind terms, which are not permitted at public companies, were possible only because SpaceX is privately held. They were just one way Musk has used SpaceX as a kind of piggy bank over the last two decades, according to an examination by the Times based on corporate filings, lawsuits, internal documents and interviews with people close to the firm.…