First, the iPhone aluminum body is anodized and not painted. Anodizing is a controlled oxidation process, essentially giving the metal a thin layer of natural "rust". This is not as bad as it sounds as metal oxides are essentially ceramics, which usually are very hard materials. This is especially convenient for aluminum, being a fairly soft and porous material. Aluminum oxide is colorless and transparent enough to let the natural metal reflect light through it and top of that you can even seal color pigment in the pores, under the outer ceramic layer. This is how you get the space grey, rose gold or jet black look.
The problem is that the coating of course is only skin deep, so there is a chance that it can crack and peel off if the adhesion to the base metal is poor, which appears to be what is happening here. My bet is that the problem is at least partially related to the switch from 6000- to 7000-series aluminum that happened between iPhone 6 and 6S. (Remember Apple "innovating" a new 40% harder aluminum grade for this product?). 7000-series is much harder than 6000-series (resolving the "bend gate") but does of course come with some drawbacks, like all materials. Besides the longer machining time, the other issue is that it is more difficult to anodize well due to it's metallurgy (high amount of zinc).