Lol, it was not unexplained. They'd gotten over the model 3 problems looming over the company and were starting to bring in very high profits per car as well as having profitable quarters. Once that happened, that also made entry into the s&p500 a possibility which if happens, typically also drives the stock price up as billions of *(dollars of) shares get bought up for ETFs and removed from circulation due to being held longer and not traded.
It was obvious to anyone watching it that something was going to happen IF the model 3 was a success and they became profitable. The risk was were they going to pull it off, and there was legitimately a point where they almost didn't.
As soon as those crazy high margins dropped off years later, the stock came down hard.
Edit: they'd also been getting credit rating increases prior to this, which was a lead up to the S&P500 inclusion, which were bullish signals.