In animals, gas exchange between blood and tissues occurs in billions of microvessels. Red blood cells must squeeze to pass through these narrow vessels: but why do the vessels need to be so narrow? Using the embryonic zebrafish trunk as a model, I will show that pressure feedbacks created when red blood cells enter the finest vessels act to uniformly partition red blood cells and prevent the vessels closest to the heart from short circuiting the network. More generally I will describe our new computational algorithms for calculating the optimal wiring of microvascular networks, which are exposing some of the physical principles that underlie these networks, as well as how these physical functions are lost and recovered following disease or damage.