The chemical processes occurring within a living cell or organism that are necessary for the maintenance of life. In metabolism some substances are broken down to yield energy for vital processes while other substances, necessary for life, are synthesized.