I would like to ask if the games are already cracked, then how does the game softwares bifurcate between legit and non legit gamers? If software can do that, then wouldn't it defeat the whole purpose of cracking the game?
I expect it has to do with exactly how the game is cracked by pirates. So far as I'm aware, most games use a "key" to authenticate against pirated copies. In the olden days, these keys would be provided separately and you'd input it after installing the game from CD (hence "CD Key") although using more modern game platforms like Steam, I believe the "keys" are just input by the system after being generated based on your account ID, or something.
Bottom line - pirates crack the game by finding ways to circumvent not having a valid key. I won't pretend to understand the nuts and bolts of how cracking a game works - I've never tried it so I have no idea - but that's the ultimate goal.
If all the pirates did was circumvent the portion of code that asks for a key at the start / during installation, then the key's value will still be undefined in the code. Developers can, of course, check for the assigned key value at any time while the game is running. They know where the value should be stored since the wrote the whole thing. If the value is not defined (properly) they can have optional code that executes and ruins the game. Avoiding this functionality would require pirates to somehow identify ALL areas of the code that check the key value - no easy task without access to the source code!
Keygen programs that generate supposedly valid keys can be foiled in a similar manner by defining a subset of seemingly valid keys to be invalid instead. The game's code can keep track of those, and even allow them to "work" during installation and then go off the rails later. But the keygen program would have no way of knowing these keys aren't good.
And if the games can do that, then why allow the non legit gamers to play the game in the first place?
You could, of course, program your game to shut down entirely instead of doing all these weird things. There probably ARE many games that do exactly that - they just aren't worth making internet videos about. However, as Timmy Jim pointed out, the purpose of this odd behaviour is to "troll" pirates by letting them think they've gotten away with it and then ruining the experience after they've already spent a few hours playing.
It also has the side-effect of letting them play for a bit and hopefully get hooked on the gameplay or invested in the story, which might encourage these thieves to go ahead and buy a legitimate copy after all. Of course, that's what demos are for, but pirates rarely bother with demos in my experience.