Trump knew before the election took place that he could not win. He **** up totally with the Covid crisis and his love afairs with Putin and even Kim Jung Un and his constant lies and failure to do as he had promised, and he knew this.
So he PREPARED IN ADVANCE, with a lot of help from his collaborators, to make the election look fraudulent. He did this by telling his supporters to vote in person, and this would mean that their votes would be counted first, and then when the mail in ballots went against him he would start screaming STOP THE STEAL! and other shrill lies.
Trump KNEW he would lose big, and after he lost big, he knew that he had lost. Everyone told him so.