You're thinking of wallhacks or wallhacks+aimbot
Aimbots only aim at things you can see, it's one of their main features. That way you won't snap into someone's head through a wall which would make everyone know you're hacking and get you banned.
Also yes these were invented a long time ago because people got caught snapping through the wall when CS servers started recording demos.
Thanks to latency & the realities of the internet, the server has to bias towards sending data the client can't strictly see/hear at that exact moment, but potentially _could_ see if they move. Which is enough to give a wallhacker a meaningful advantage still.
But what you can't do anymore is see where all the enemies are going at the start of the round and run to the weaker part of the map or whatever. So reduced effectiveness, but still a thing.