Summary
Balance arises from the interplay of external forces acting on the body and internally generated movements. Many animal bodies are inherently unstable, necessitating corrective locomotion to maintain stability. Understanding how developing animals come to balance remains a challenge. Here we study the interplay between environment, sensation, and action as balance develops in larval zebrafish. We first model the physical forces that challenge underwater balance and experimentally confirm that larvae are subject to constant destabilization. Larvae propel in swim bouts that, we find, tend to stabilize the body. We confirm the relationship between locomotion and balance by changing larval body composition, exacerbating instability and eliciting more frequent swimming. Intriguingly, developing zebrafish come to control the initiation of locomotion, swimming preferentially when unstable, thus restoring preferred postures. To test the sufficiency of locomotor-driven stabilization and the developing control of movement timing, we incorporate both into a generative model of swimming. Simulated larvae recapitulate observed postures and movement timing across early development, but only when locomotor-driven stabilization and control of movement initiation are both utilized. We conclude the ability to move when unstable is the key developmental improvement to balance in larval zebrafish. Our work informs how emerging sensorimotor ability comes to impact how and why animals move when they do.