There is more to it than that.
There are many giveaways than an algorithm can pick up. All intricate details of cheating detection algorithms aren't revealed for obvious reasons. But some of this stuff is fairly well known. For example it's about the time spent on moves. Cheaters will tend to make their moves at a fairly constant pace (because how long it takes them to check the position with the chess engine is constant). They come up with brilliant moves quickly, but take a bit longer for obvious or forced moves that a human would do without thinking. Cheaters generally don't premove, nor do they ever make moves real fast - which humans often do in time trouble. It's for the exact same reason.
There's also a thing such as blur rate - how often someone switches away from the game window. And certain other heuristics too (hold alert).
Obviously a cheater can avoid triggering some of the alarms, some of them are quite easy to beat (eg. for the blur, just have your chess engine run on a separate device), but in the long run it's difficult for them not to raise various other red flags at the same time. A smart person might figure out how to do it - online cheaters aren't that smart though, and unsurprisingly so, given that online cheating is essentially an exercise in futility.
This doesn't mean smart people don't cheat at chess at all. They do; at actual chess tournaments, where there's something at stake, be it prize money or real titles.