Thin film interference occurs when light waves are reflected off the surface of a thin film and interfere with each other. When the light waves reflected off the top and bottom surfaces of the film are in phase, they constructively interfere and certain wavelengths of light are amplified, producing colors. This explains the rainbow patterns seen on surfaces like oil slicks and beetles. Anti-reflection films are designed to have a thickness that causes the reflected light waves to be out of phase and cancel each other out, reducing reflection.