What determines whether a material is transparent or opaque?

Chemical composition determines whether it absorbs the light. Uniformity determines whether it scatters the light. To be transparent, it should neither absorb nor scatter strongly.