Much of the value that a CEO adds is in figuring out
which rules can be broken without adverse consequences. They're accountable for results; if they raise shareholder value doing terrible things but never get caught, that's a win for shareholders, and they get to keep their position. If they do get caught, they get to be the fall guy, they resign, the board gets to say "We are shocked that such things occurred, we had no knowledge of it, the guilty parties have been sacked, and cleaning up the mess they made is a top priority for the organization." Witness Uber, Volkswagon, Boeing, and Wells Fargo.
The moonlighting employee has the same options. Don't get caught. If you do get caught, you get fired, just like the CEO.
This is also a good portion of why CEOs get paid so much. The average person doesn't like to inhabit the Hobbesian reality that CEOs do, where they're accountable for results and any bad things happening are automatically their fault. They want a world where if they take the right actions and follow the rules, they get some reasonable amount of security. Employment is basically a way to create an artificial island of "if you follow the rules, you get paid", at the expense of the company capturing much of the value you create. Most people take this bargain, because they value security over maximizing profit. Those who don't are always able to take the opposite side of the trade, and become an owner/executive, at the cost of being exposed to all the risks of the real world.