Revealing the logic of the body’s ‘second brain’