Poor quality paints usually do not have good adhesive properties. Furthermore the paint film shrinks on drying, leading to stretching of the film, which leads to cracking. Application of the paint by an inexperienced person can result in a very thin coat being applied as the wet paint is spread over a large area. Applying paint on an unprepared surface also leads to flaking. Painting on wood without first priming it is another cause of flaking. Some alkyd-based paints harden with time and become brittle, leading to cracks.
In order to repair cracking and flaking, first gently remove the loose paint. Do this with a wire brush or a scraper. Use a sand paper to make the area even, and remove parts of the paint film that have not firmly adhered to the surface in order to prevent future flaking. Sometimes flaking occurs in the superficial as well as the underlying layer. In such a case a filler will be useful. Always use a good quality primer, especially on woods, and then do the repainting job.