I read online that a plywood backer may or may not be required behind a breaker panel, and that it must be painted black. What are the rules for this? And why must it be painted black? I'm in MI, USA for reference.
Plywood is usually used when mounting a panel to masonry walls for a few reasons.
Masonry is not a great insulator, which can lead to problems especially where the wall is below grade. The cabinet has to be bonded to the grounding electrode system. Because of this, if you mounted the cabinet directly to a below grade masonry wall, you could end up with a ground loop.
Masonry walls are also not great at stopping moisture. If the cabinet was mounted directly to the wall, there's a possibility of moisture in or on the cabinet, which can lead to problems.
Because masonry is not a great insulator, a ground-fault could cause the wall to be energized.
Ease of Installation
It's much easier to attach electrical devices, cables, and raceways to plywood than masonry.
As for the color of the plywood, I've never heard of a requirement to paint it black.
It is up to the local authority what to require. The NEC only says that work be neat and workman like and that equipment be firmly attached to the surface to which it is mounted. It's generally understood that it's impossible to firmly mount anything to drywall, thus a more substantial surface is required. What that is is up to the local authority.
I've never heard of any requirement for color but I'm not too surprised. In particular if the panel is in public view I could see some requirement beyond unfinished plywood. A requirement such as it be painted, but a specific color is beyond typical requirements.
In SE Pennsylvania and the surrounding area, I don't think I've ever seen a panel mounted to a residential masonary wall without a piece of wood between the panel and the wall. I started reading NEC around 1973 and would bet money (not a lot) that in one or more of the code cycles then or since stated that a painted piece of wood could be used for installing a panel in a damp location, but it's possible I just dreamt that.
And besides being a, maybe just a traditionally accepted, way of protecting the panel from the damp wall, if you have enough board above the top of the panel it also gives you something to get that first staple in within 12".
For the color, I like battle ship gray for a gray panel, a shade of brown for a brown panel or whatever color you have a half a gallon of laying around.