Butterflies typically produce black wings using the pigment melanin. The melanin is incorporated into the cuticle secreted to form the scale. Scales are not solid structures; they have nano-structure. Scales have airspaces, and internal features such as ridges and spikes at the nano-level. When a photon leaves a cuticular area and enters an airspace, it does so at an angle, rather than perpendicular. This makes the photon path more tortuous increasing its chances of absorption by contacting a pigment molecule.
This can be demonstrated by comparing the absorbance of a black scale in air and a black scale dipped in a solvent that fills the airspace and has a similar refractive index to the cuticle. The scale in air is more absorbent than the scale in solvent because the solvent disrupts the internal structure. These types of structures can have useful engineering applications.
P.Vukusic, J.R.Sambles & C.R.Lawrence. Structurally assisted blackness in butterfly scales. Proc. R. Soc. Lond. B (Suppl.) 271, S237–S239 (2004)