The proteins in raw egg whites are folded into tiny little packets, repelling each other, and swimming in a sea of water.
When they are heated, however, they bounce around out of control, unfold, begin to latch onto their neighbor proteins, and trap the sea of water between them in tiny nets.
The molecules join together so tightly that they deflect the rays of light that formerly passed through the white, rendering it opaque (and white).