I'm sure you're asking @pry0cc here, but this is actually a topic that me and a few political friends were discussing not long ago.
My 1st theory is that each machine is created (somewhat) equal. Or at least equal enough to have the same vulnerabilities across the board. (Now, I'm not counting the paper votes or the votes that had to be manually counted btw). They could have designed some kind of a worm to travel through those machines and fudge the vote counts or somehow edit what person voters chose.
My 2nd theory is that it's possible they could have purchased or pwned a voting machine for testing, and took a look at its network traffic & what it looked like when sending voting info through the wire. Then wrote up some kind of script to inject packets that had fictitious and randomized information about a fake person but that cast their vote for whatever party the script writer chose.
My 3rd theory is that they could have MiTM the traffic and delayed it a little bit, editing the packets on the fly. (With the use of a script ofc).
My 4th theory is that they had people on the inside, miscounting and perhaps inserting fake votes on purpose.
Now, some of these seem a bit far fetched even for me lol because here I'm assuming that:
A. The traffic isn't encrypted, or if it is then the have both the encryption and decryption key(s). (Unlikely)
B. The machines are Internet connected. (I don't know, I've never voted so I didn't have the chance to check)
C. The machines are built similar and are running the same software. (Again, don't know because I've not even voted once)
D. They have the resources and the people to conduct an operation this large. (My two cents is that it was either funded or conducted by a foreign government like China, S.Korea, Russia, etc. Or perhaps the election wasn't rigged at all? We may never know.)