Paint can peel due to improper preparation, not using a primer, painting over a dirty surface, too much moisture in the area, and using latex paint over oil-based paint are among the most common reasons.
Paint begins to peel due to poor adhesion or too much water or condensation on paint that isn’t meant to withstand moisture. If you have peeling paint in a bathroom, it is most likely due to moisture and you will need to make sure you use paint that can hold up to moisture and is mold and mildew resistant.
It is possible to fix peeling paint, but it can be a tedious job. You will need to scrape off all the peeling paint, fix the surface where necessary with putty, sand it smooth, prime, and repaint. You should not need to remove all the paint in the area if you are careful to use putty and sanding to smooth the surface after you scrape the peeling areas.