Behavior emerges from vast neuronal networks that span the entire brain, and finding order in this immense complexity is a central aim of neuroscience. Here I will describe my ongoing work to unravel the brain-wide circuitry implementing motion-guided behavior in larval zebrafish. I will present a combination of theoretical and experimental results that illustrate information processing principles in several brain regions involved in the optomotor response. First, I will discuss how optimal estimation theory and natural sensory statistics predict visual motion processing by the retina. I will then present a theory for how the interplay of sensory drive, behavioral demands, and neurobiological constraints shapes neuronal responses in a retinorecipient area called the pretectum. This theory suggests that premotor coding of stimuli driving behavior strongly affects pretectal representation, an observation that may apply to other sensory areas in the central brain.