Diamond sparkles because of total internal reflection.
Total internal reflection is a phenomenon that occurs at the boundary between two mediums, such that if the incident angle in the first medium is greater than the critical angle, then all the light is reflected into that medium.
Along with total internal reflection, the following are the three other factors that determine the sparkling of the diamond:
Reflection - When a ray of light approaches a smooth polished surface and the light ray bounces back, it is called the reflection of light.
Refraction - Refraction is the bending of a wave when it passes from one medium to another. The bending is caused due to the differences in density between the two substances.
Dispersion - When white light is passed through a glass prism it splits into its spectrum of colors (in order violet, indigo, blue, green, yellow, orange, and red), and this process of white light splitting into its constituent colors is termed as dispersion.