There are potentially a couple of causes of walking. Commonly, it is a barrel not well stress-relieved. Processes like rotary forging and button rifling for example, may result in quite high residual stresses and, if not properly stress relieved, the heating of the barrel from firing a few rounds can see it move.

Another one is where the way the rifle is bedded or fitted up results in movement due to thermal expansion. As you know, steel expands as it gets hot, and if that expansion is constrained on one side, such as by a barrel screw or other feature pressing against the barrel on one side, that can cause walking. Perhaps the most extreme example of this that I've seen is in teh case of combinations, drillings and the like, where the rifle barrel is soldered to another barrel, and as the rifle barrel heats up it expands on the side away from the joint, but on the side where the joint is it has the combined effects of a heat sink and the rigid joint preventing movement.