NIHAO XIX: how supernova feedback shapes the galaxy baryon cycle