Metabolism is built on a foundation of organic chemistry, and employs structures and interactions at many scales. Despite these sources of complexity, metabolism also displays striking and robust regularities in the forms of modularity and hierarchy, which may be described compactly in terms of relatively few principles of composition. These regularities render metabolic architecture comprehensible as a system, and also suggests the order in which layers of that system came into existence. In addition metabolism also serves as a foundational layer in other hierarchies, up to at least the levels of cellular integration including bioenergetics and molecular replication, and trophic ecology. The recapitulation of patterns first seen in metabolism, in these higher levels, motivates us to interpret metabolism as a source of causation or constraint on many forms of organization in the biosphere. Many of the forms of modularity and hierarchy exhibited by metabolism are readily interpreted as stages in the emergence of catalytic control by living systems over organic chemistry, sometimes recapitulating or incorporating geochemical mechanisms. We identify as modules, either subsets of chemicals and reactions, or subsets of functions, that are re-used in many contexts with a conserved internal structure. At the small molecule substrate level, module boundaries are often associated with the most complex reaction mechanisms, catalyzed by highly conserved enzymes. Cofactors form a biosynthetically and functionally distinctive control layer over the small-molecule substrate. The most complex members among the cofactors are often associated with the reactions at module boundaries in the substrate networks, while simpler cofactors participate in widely generalized reactions. The highly tuned chemical structures of cofactors (sometimes exploiting distinctive properties of the elements of the periodic table) thereby act as 'keys' that incorporate classes of organic reactions within biochemistry. Module boundaries provide the interfaces where change is concentrated, when we catalogue extant diversity of metabolic phenotypes. The same modules that organize the compositional diversity of metabolism are argued, with many explicit examples, to have governed long-term evolution. Early evolution of core metabolism, and especially of carbon-fixation, appears to have required very few innovations, and to have used few rules of composition of conserved modules, to produce adaptations to simple chemical or energetic differences of environment without diverse solutions and without historical contingency. We demonstrate these features of metabolism at each of several levels of hierarchy, beginning with the small-molecule metabolic substrate and network architecture, continuing with cofactors and key conserved reactions, and culminating in the aggregation of multiple diverse physical and biochemical processes in cells.Content from this work may be used under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 licence.