In replays, hackers may accidentally move their screen or click on units that should be invisible to them.
Some advanced variants allow users to see exactly what their opponent is producing (units or upgrades) without ever having to scout the enemy base. starcraft remastered maphack
Modern anti-cheat systems, such as those used by Blizzard, can log a "fingerprint" of your hardware (CPU, GPU, and MAC addresses). If banned, simply creating a new account may not be enough to return to the ladder. In replays, hackers may accidentally move their screen
The StarCraft community is highly vigilant. Players often share replays of suspected hackers with prominent community figures or on forums like r/starcraft for public "analysis" and reporting. How to Detect a Maphacker such as those used by Blizzard