The same thing that happens when you breach any other contract.
Anyhow, for anything below a managerial role I've never seen a company enforce those rules. They're mostly a deterrence, I suppose.
[1] https://www.haufe.de/recht/arbeits-sozialrecht/wenn-ein-arbe...