Why transparent areas need a background color at all#
JPEG has no alpha channel — every pixel is fully opaque. A PNG with a transparent background converted naively (without explicitly filling that area first) renders those pixels as black in most implementations, since an unset alpha-blended pixel defaults to black rather than the color a viewer would expect. Filling the transparent area with an explicit background color first — before drawing the image on top — avoids that surprise entirely.