as thenorthwind says getting caught is the issue. I passed someone on my commute a while back, old specialized iirc, something in a tape wrapped box on the rack powering one of the wheels, I knew it was dodgy coz the guy didn’t have a chain fitted. Another guy I’ve seen a few times has a leccy bike, I think I’ve spotted him not pedalling uphill so presumably both of those are illegal, but with a silent electric motor (if the first guy actually fitted a chain) if you noticed a policeman taking an interest you could just start pedalling and blag it was a proper e-bike, with that noisy petrol engine strapped on to your frame you’re going to struggle to claim it’s legit and it’s rather noticeable.
But the chances of anyone actually looking out for this stuff is very low, just an extra something to throw at you if you get caught doing something else illegal (or used as a mitigating circumstance if some idiot drives over you)