The SPICA mid- and far-infrared telescope will address fundamental issues in our understanding of star formation and ISM physics in galaxies. A particular hallmark of SPICA is the outstanding sensitivity enabled by the cold telescope, optimised detectors, and wide instantaneous bandwidth throughout the mid- and far-infrared. The spectroscopic, imaging, and polarimetric observations that SPICA will be able to collect will help in clarifying the complex physical mechanisms which underlie the baryon cycle of galaxies. In particular, (i) the access to a large suite of atomic and ionic fine-structure lines for large samples of galaxies will shed light on the origin of the observed spread in star-formation rates within and between galaxies, (ii) observations of HD rotational lines (out to ~10 Mpc) and fine structure lines such as [C ii] 158 μm (out to ~100 Mpc) will clarify the main reservoirs of interstellar matter in galaxies, including phases where CO does not emit, (iii) far-infrared spectroscopy of dust and ice features will address uncertainties in the mass and composition of dust in galaxies, and the contributions of supernovae to the interstellar dust budget will be quantified by photometry and monitoring of supernova remnants in nearby galaxies, (iv) observations of far-infrared cooling lines such as [O i] 63 μm from star-forming molecular clouds in our Galaxy will evaluate the importance of shocks to dissipate turbulent energy. The paper concludes with requirements for the telescope and instruments, and recommendations for the observing strategy.