Teaching a yearling to move away from leg pressure on the ground — applied by the handler's hand, a dressage whip, or a flag in the position where a rider's leg would eventually hang — is direct preparation for one of the most fundamental ridden aids and gives the horse an early introduction to the concept that pressure from the side of its barrel means move sideways or forward. This makes the transition to the first ride significantly easier because the horse already has a frame of reference for what the leg means.
The exercise is introduced from a position at the horse's shoulder, with the handler's inside hand holding the lead rope with a slight bend in the horse's nose toward the handler. The outside hand or a dressage whip tip applies light tapping pressure to the horse's barrel in approximately the position where a rider's leg would rest — just behind where the girth would sit. The moment the horse moves its body away from that pressure, even one step, the tapping stops completely and the horse is allowed to stand.
Over repetitions, the horse learns that tapping pressure on its barrel means move away from the pressure, and the response becomes quicker and softer. Eventually the horse responds to a single tap rather than rhythmic tapping, which is the level of refinement appropriate for the yearling stage. This exercise is introduced on both sides so the horse learns to move away from pressure from either direction equally.
This leg pressure education on the ground transfers directly to the first ridden experiences. A horse that has already learned that pressure on its barrel means move over does not need to figure out the concept from scratch when a rider is on its back — it simply applies an already-understood response to a familiar cue from an unfamiliar source.