"Lock subdiv to frame" is the simplest way to prevent popping shadows because it locks (freezes) the set of micropolygons being used to cast shadows for the whole animation. You choose a frame number that you think best represents the view of the terrain that will be visible throughout the animation (this might just be a frame somewhere near the middle). The renderer then looks at where the camera is on that frame number and uses that camera to subdivide the terrain to generate the shadow-casting micropolygons. Now, for every frame the shadow-casting polygons will be identical, eliminating one of the causes of popping shadows.
However, it has the drawback that the shadow detail is optimal only when the render is of a similar viewpoint to the frame being locked to. If you render parts of the terrain that aren't visible in the locked-to frame you may lose detail in the shadows or have large areas of false-positive or false-negative shadows, but this can often be mitigated by using the "ray detail region" and/or "ray detail region padding" settings. They change the frustum used to generate the shadow-casting micropolygons. Nevertheless, if the camera moves a great distance away from its position on the locked-to frame the renderer might make suboptimal choices about the level of detail of the shadows, possibly leading to longer render times if there is too much detail in some areas, or it might render too low detail if you move closer to the terrain than the locked frame.
If your camera doesn't move very far, "lock subdiv to frame" should usually work, possibly combined with some ray detail region padding.
If you're using "lock subdiv frame" you shouldn't need to use "stabilise ray detail" because it's designed to blend between different levels of detail. If "lock subdiv to frame" is enabled, there is only one level of detail, and enabling "stabilise ray detail" will only make the renderer do extra work to try to blend between the multiple levels of detail that are exactly the same. "Stabilise ray detail" has problems of its own, sometimes causing a cross-hatch appearance in the shadows and reducing overall apparent detail in the shadows, and it can't stabilise some shadows originating from outside the ray detail region (whereas "lock subdiv to frame" does this). But it's a tool that can be helpful in situations where the camera moves too much to use "lock subdiv to frame".
Matt