If someone leaves without working their notice
The person leaving should try to reach agreement with their employer if they need to leave without working some or all of their notice.
If someone leaves without agreeing it with their employer first, they could be in breach of contract. The person could have a court claim made against them if the employer ends up with extra costs.
If someone leaves early, the employer only has to pay them for the time that they've worked, including any money owed for untaken holiday.
If the employer ends up with extra costs
The employer can end up with extra costs if someone leaves before or during their notice (without agreeing it). For example, they have to spend more to hire someone else on a short-term contract. In these situations the employer can make a court claim to get the money back from the person who left.