Some employers offer contractual maternity pay that is better than Statutory Maternity Pay (SMP) and this is something that trade unions can negotiate with employers.
If you receive contractual maternity pay and you decide not to return to your job, you only have to repay it if this was agreed in advance or specifically stated in your maternity policy or your contract. In these cases, you would only have to pay back the extra contractual pay, not the SMP part of your maternity pay.