What they gain with such threats is control over you with an installment of fear to ask for a raise or do anything that separates you from the company because that clause makes you unemployable for X years while it's active. The former employer (O) just needs to check your LinkedIn profile and send a notice to the new employer (N) that everything you write for N must be submitted to O so it can unilaterally decide if it actually belongs to them. It's absurd but I can believe companies try this because they have nothing to lose.
He refused the offer but I would like to know how common such a clause is, this is why I ask. Until now, I haven't thought about how careful you have to be when signing what one could assume is an absolutely benign and common work contract.