As an employee I cannot understand why someone would do it
Because if you can't get a job legally ( for whatever reason ) and you need money and the offer is there, many people would take the chance.
you are also beholden to anyone who may shop you for the reward
Most people would keep quiet about it if they had sense. Not that I'm advocating people should work illegally in the UK.
As an employer the situation is even worst, as you would be liable to the back taxes, penalties and pay up to minimum wage.
Yes, employers would be prosecuted if found out.
The there is the danger of a jail sentence if any of the electrical work causes a problem.
Doesn't bear thinking about what could go wrong. No-one unqualified should be working with electrics.
"Cash in hand" suggests legal work without benefits (a thing in the US, not sure about the UK).
No, it's illegal in the UK as you are not paying tax/NI, but if for example you are a tradesman doing jobs off the books for friends, and friends of friends for example, it would be quite difficult to prove. If large building firms do this for example, much higher chance of being caught.