For sure a software engineer from Tesla, or even a manager, can get an idea of how valuable/productive a coder is without fully understanding the code in detail. How many PRs? What does the code do? How was it reviewed? What value does it bring to stakeholders (users, business revenue)? Sure enough this way you can get a rough idea of how much work somebody does and if it is of any importance.
The loyalty part is in the timing: 30-60 days. A period with a lot of uncertainty for Twitter employees. The Musk takeover in the air but even if that would not follow through, there were already severe job cuts in the pipeline by Twitter's board.
If under those conditions you kept your head down and kept coding like a stoic, then you're a keeper.