The paint could be releasing because of water problems or an old leak, or the skin of the wall board has come off or you have at one time oil paint over latex paint.
Now, I would pull off all the paint that will release easily. Because normally, the new paint will cause the chipping paint to release even more. Its the moisture in the new paint.
Now, when you get the paint chips off, then you need to spackle in that void to make it even with the old paint. Spackle is good because it will not shrink. Then when dry, lightly sand then prime and this should work.