Why is it, on the atomic level, that light is always reflected at the same angle as it is incident (law of reflection)? How do the electrons that are changing orbits know what the angle of incidence is?
The short answer is that the electrons (that change orbits thus emitting light photons) do not know what the angle of incidence is, but still the angle of reflected light is equal with the angle of incident light.
The full explanation follows.
Let us first define the wavefront of a wave as the geometric place where all oscillations in the wave are in phase.
Suppose now you have a ray of light that encounters a surface and reflect on to this surface. See the figure below.
The wave front of the incoming light ray is drawn with thick red line.
Figure 1 corresponds to the situation where the wave front just touches the surface of the reflecting surface. Only the electrons from one atom situated at point A on the surface will start to emit light. The light will be emitted symmetrical in all directions in space in the upper half of a sphere having as center the point A.
Now suppose the incoming wave front has travelled a bit further and is in position shown in figure 2. Only the electrons from the all atoms situated between points A and B will emit light. But because atoms situated at point A started emitting light before atoms situated at point B the radius of the sphere centered on A will be larger than the radius of the sphere centered on B (remember the light is emitted uniformly in these spheres). These spheres are also drawn on the figure with blue color. Therefore the corresponding wavefront of the reflected wave is a line tangent to all these spheres where the light that comes from each atom is located. (drawn in figure with a thick green). Because on the wavefront all oscillations are in phase they will interfere constructively and form the reflected ray of light.
Figure 3 and 4 corresponds to the situation when all the incoming wavefront has been reflected by the surface. Now all the electrons of the atoms from A to C emit light and the corresponding reflected wave front is also drawn on the figure. Now, because of geometrical considerations (the reflected wavefront is tangent to all small spheres), the corresponding reflected ray of light (formed by constructive interference of all photons emitted by each atom) will make an angle of reflection equal to the angle of incidence.