When an electromagnetic (EM) wave transitions between different media, its frequency remains constant due to the boundary conditions that the electric and magnetic fields must meet. Specifically, the perpendicular component of the electric displacement vector D must be equal at the boundary to ensure continuity. This requirement can only be fulfilled if the frequency of the wave is the same on both sides of the boundary. The discussion highlights the fundamental principles governing EM wave behavior at interfaces. Understanding these principles is crucial for applications in optics and telecommunications.