Why do different materials hae varying degrees of transparency?
Here’s what I found on Wikipedia: When light encounters a material, it can interact with it in several different ways. These interactions depend on the nature of the light (its wavelength, frequency, energy, etc.) and the nature of the material. Light waves interact with an object by some combination of reflection, and transmission with refraction. Some materials, such as plate glass and clean water, allow much of the light that falls on them to be transmitted, with little being reflected; such materials are called optically transparent. Many liquids and aqueous solutions are highly transparent. Absence of structural defects (voids, cracks, etc.) and molecular structure of most liquids are mostly responsible for excellent optical transmission. Materials which do not allow the transmission of light are called opaque. Many such substances have a chemical composition which includes what are referred to as absorption centers. The link below explains more.
I am going to tackle this question at the most basic level I can, as I think that is what you are looking for. The answer to your question has to do with how the material responds to an electromagnetic field. Light, as you hopefully know, is an electromagnetic field, which means that it is a field that interacts with charges (like electrons or ions). So how charges move in a material will dictate how the light interacts with it. Imagine, for example, an ideal conductor. In a conductor, charges are free to move when a field is applied, and that means that the charges will move to wherever they need to be to perfectly cancel the field. Now, let’s imagine a bunch of conductive wires, lined up in the same plane, all parallel to each other and spaced by the same amount. The charges in these wires are free to move down the length of the wire, but they can not move perpendicular to the wires. Since they can not move in the same way, this will interact with an electric field differently than a