why IC body is always black?

Lamp black/soot is cheapest lightest non fading dye, so it´s very popular everywhere (include speaker cones in that).

And blocking light is a desirable quality
Early glass-cased semis were sometimes covered with black paint to reduce the effect of light.
Probably with mixed results.

https://www.ebay.com/itm/124738742011

Back in the day In used to scratch OC71 paint off to make a photo transistor.
 
Epoxy (Novolak) can be colored in many ways (red, green, white, etc.): for opto-couplers, some exist in two variants. The white one has a slightly better transfer ratio, but a lower immunity to ambient light and the black one has opposite properties.
The natural color of epoxy, without any colouring or filler is an unattractive, dirty translucent tone, and it lets some light in, which is generally undesirable
 
  • Like
Reactions: Wik
I was once probing a CMOS chip (requires a microscope and a micromanipulator probe). The chip was doing what it ought to do, considering the loading effects of the probe. I made the mistake of turning on the probe station light while the chip was powered up. That was the end of that chip.

I wonder if radiation of heat is a reason for black?
 
@Wik There are IC packages with a little entertainment window... lookie lookie carefully and you maybe can see the electrons jumping around.
:🙂

IC package with TV ::-----))).jpg