Optical properties describe how a material interacts with light.
Refractive index (related to how light bends and slows down in the material) and absorption (how much light energy is absorbed by the material) are primarily determined by the material's electronic structure – specifically, how electrons in the atoms and bonds respond to the electromagnetic field of the light wave.
The electronic structure (available energy levels, band gaps, types of bonds) is fundamentally determined by the types of atoms present and how they are bonded together, which is dictated by the chemical composition and crystal structure.
Mechanical hardness, electrical conductivity, and thermal conductivity are also influenced by composition and structure, but they do not directly determine the primary optical characteristics like refractive index and absorption patterns as fundamentally as chemical composition does.