> I’m not sure why people sign these things though...
The clauses are usually (in my experience anyway) restricted to things that are "related" in some way to your core work. I personally don't question the boundaries on this "related" and assume that anything that involves writing code belongs to my employer. This doesn't bother me because I rarely write code outside of work [0], and I suspect most people who are employed full-time to write software are the same.
[0] Rare exceptions: solving silly puzzles when I get nerdsniped, and automating random things on my personal phone/laptop. If my employer finds out I'm doing either of those and would like to claim they own the IP for them, they can be my guest.