This and the other scenarios you mention are deliberately created to make the player have fun. They are all engineered to manipulate the player’s emotions, the intention is to trigger dopamine and other neurological reactions. As I said, that doesn’t have to be a bad thing!
You don’t have to think about it in terms of chemical reactions, but artificially creating fun is the goal, if you boil it down.
You do get that dopamine hit when you achieve a goal in Shenzen.io, or even a self-directed goal in Shenmue, whether the designers thought that way or not.
As Raph Koster says, fun is linked to progression and learning.
Progression applies to self directed goals too (you’re setting yourself a series of minor goals when driving the forklift in Shenmue).
Ironically, motivation theory tells us that the intrinsic fun of doing undirected chores in Shenmue or mastering facts about the systems in Shenzen.io is stronger than the onslaught of mostly extrinsic rewards generated by Cookie Clicker. You had less fun playing that game, that’s one of many reasons why.