Isn't there currently more shorted shares than real shares? (which in itself is questionably legal)
Is that how they work, they borrow out pretend shares?
From what I understand, shorting stocks normally works by me borrowing stocks, which I will sell immediately and later buy again to give back, and I pocket the difference between the selling price when I borrowed, and the buy back price when I return the shares. The idea is I make money when the stock's price falls, and I'd lose money if the price rose. Gamestop was a common shorting target because nobody has any hope for the failing game store, so it's reasonable to guess it's stock value will fall.
The illegality comes when I take my borrowed shares and sell more of them (to different buyers) then I borrowed.
The illegal thing is naked shorting. When you make a transaction, you have three days to actually transfer the money/shares before the transaction fails. So you sell shares you don't have, wait for the price to drop, then buy and transfer them before the failure to deliver pops, pocketing the difference between your sell and buy price. If you do it clean, it's pretty hard to detect, but if a bunch of failure to deliver alerts start popping the SEC will notice, and it's illegal in the US.
What's happening right now is mostly double-dipping, firms lending shares that were already borrowed so they get double-counted for calculating short interest. I'm pretty sure that's not illegal, and in a normal situation everybody would close out their trades eventually and re-square the numbers. This is not a normal situation though. The short sellers have to buy shares to cut their losses if the price goes up, but they're on the hook for more shares than actually exist and the ones that do exist are in the possession of vengeful retail investors who refuse to sell them. The price jumps we've seen are gamma squeezes, which is just the short sellers buying call options (which profit when the price goes up) to hedge their bets. When these shorts start expiring and the sellers have to return their shares, if internet weirdos are still death-gripping all the available shares shit will hit the fan.
Edit: I was wrong about the above thing, shorts do not expire. They still have to return them eventually and they're paying interest until they do (And I can't imagine what the interest payments are on a stock that's going apeshit like this), but there's no hard deadline. It's a game of chicken between the hedge funds and the memers, and if the memers win GME goes $1000+ a share and hedge funds start getting cratered.