Analysis of information sources in references of the Wikipedia article "Refraction" in English language version.
It results from the boundary conditions which the incoming and the transmitted wave need to fulfill at the boundary between the two media. Essentially, the tangential components of the wave vectors need to be identical, as otherwise the phase difference between the waves at the boundary would be position-dependent, and the wavefronts could not be continuous. As the magnitude of the wave vector depends on the refractive index of the medium, the said condition can in general only be fulfilled with different propagation directions.