The short answer is that light behaves like a wave of electromagnetic energy, and any material that can transmit the wave is transparent.
So why do some materials transmit the wave, while others absorb or reflect the light energy?
The answer is more complex.
It involves the state of the electrons in the material and the ways they are bound to the nuclei of the atoms, with resulting differences in the way they behave when an electromagnetic wave impinges on the material.
If the electrons cannot absorb any energy, then the wave is passed through unmolested, and the material is transparent.
If they can rob the wave of any energy, then it is dimmed, obscured or absorbed, and the material is more or less opaque.
Some materials, like polished metal, can absorb and re-emit energy, so they are reflective.
Clear glass and most pure crystals can neither reflect nor absorb much light energy, so most of it passes through, though the waves are slowed down dramatically, and if the light enters at an angle, it emerges bent.
Until this century, it was not known why a diamond is transparent while a piece of coal is not.
They are formed of the same carbon atoms with the same electrons.
Now scientists know that the optical wavelengths of light do not have quite enough energy to reach the threshold of excitation for the more tightly bound electrons in a diamond, so light passes through.