The hot gas mass fraction in halos: From Milky Way-like groups to massive clusters | Synapse