How to prepare wall with peeling paint for painting
If you're using an electric sander then you want to keep that moving all of the time &amp; not linger in any areas. Lingering will heat up the paint &amp; cause it to release. If the paint is peeling off in strips you may also have a poor paint job where Priming before Painting wasn't practiced. But, you won't make that mistake.

You can hand or pole sand with the sandpaper or sanding screen to avoid so much heat &amp; it will also demonstrate how much heat sanding creates. Additionally, you can Wet-Sand with nothing but a Wet household Sponge. This doesn't create heat or even dust. But, definitely remove any loose paint edges as best you can.

If the paint keeps pulling off where you haven't sanded &amp; you have plenty of Joint Compound or Spackle to feather the edge where you finally find sound paint, then rip off as much as possible...This part assumes you have plenty of Primer &amp; Paint to tackle the larger area(s), once with Primer &amp; twice or with 2-coats of Paint.