We investigate the relationship between the star formation rate (SFR), stellar mass (M*) and molecular gas mass ($M_{H_2}$) for local star-forming galaxies. We further investigate these relationships for high-z (z=1-3) galaxies and for the hosts of a local sample of Active Galactic Nuclei (AGN). We explore which of these dependencies are intrinsic and which are an indirect by-product by employing partial correlation coefficients and random forest regression. We find that for local star-forming galaxies, high-z galaxies, and AGN host galaxies, the Schmidt-Kennicutt relation (SK, between $M_{H_2}$ and SFR), and the Molecular Gas Main Sequence (MGMS, between $M_{H_2}$ and M*) are intrinsic primary relations, while the relationship between M* and SFR, i.e. the Star-Forming Main Sequence (SFMS), is an indirect by-product of the former two. Hence the Star-Forming Main Sequence is not a fundamental scaling relation for local or high-redshift galaxies. We find evidence for both the evolution of the MGMS and SK relation over cosmic time, where, at a given stellar mass, the higher the redshift, the greater the molecular gas mass and the star formation efficiency. We offer a parameterisation of both the MGMS and SK relation’s evolution with redshift, showing how they combine to form the observed evolution of the SFMS. In addition, we find that the local AGN host galaxies follow an AGN-MGMS relation (as well as a AGN-SK relation), where the MGMS is offset to lower $M_{H_2}$ for a given M* compared to local SF galaxies.