The chemical compositions of the stars and gas in galaxies play a significant role in all their key evolutionary processes, from gas cooling, through star formation, to the production of new heavy elements that are released back into the gas as stars die in supernova explosions. A theoretical explanation of the production of elements heavier than helium (known simply as `metals' in astrophysics) in stars and its distribution throughout galaxies has been developing since the first postulation of stellar nucleosynthesis in the 1920s. However, there are still a number of unanswered questions in the field of galactic chemical evolution (GCE). For example, what is the most accurate way to measure the metallicities in galaxies? What are the relative contributions to GCE from different types of stars? How is this metal-rich material circulated throughout the various components of a galaxy? And how can we explain the seemingly incompatible chemical properties observed in different galaxies in the local Universe? This thesis provides an investigation into the chemical enrichment of galaxies, by utilising both observations of nearby galaxies and sophisticated GCE models within a semi-analytic model of galaxy evolution. Its core aims are a) to better quantify the chemical properties seen in low-redshift galaxies and explain there likely causes, and b) to develop an improved GCE model that can simultaneously reproduce the diverse chemical properties seen in different types of galaxies in the local Universe.\n\nWith these aims in mind, Chapter 1 outlines the key background knowledge required for such an investigation. It discusses the different methods used for measuring the metallicity of real galaxies, and their various shortcomings. It also describes simple, analytic GCE models, and the sophisticated semi-analytic model, L-Galaxies, that is used to simulate galaxy evolution in detail. In Chapters 2 and 3, I provide an investigation into the relation between stellar mass (M*), star formation rate (SFR), and gas-phase metallicity (Zg) in galaxies. It is shown that the L-Galaxies model reproduces the positive correlation between SFR and Zg in massive galaxies that is seen when using sophisticated, theoretical metallicity diagnostics. This lends support to the use of such diagnostics over simpler, emission-line ratios. It is further shown that, in the semi-analytic model, this SFR-Zg correlation is due to the gradual dilution of the gas in low-SFR, elliptical galaxies, after a gas-rich merger event. A number of signatures of this particular evolution can be seen in these model galaxies at redshift zero, including low gas fractions and low values of (Zg-Z*). Crucially, all of these properties are also seen in nearby elliptical galaxies in the Sloan Digital Sky Survey (SDSS), providing indirect evidence that such an evolutionary process is also occurring in the elliptical galaxy population in the real Universe.\n\nIn Chapter 4, I present a new, sophisticated GCE model implemented into L-Galaxies, that significantly improves on the previous scheme. It does this by accounting for the delayed enrichment of many chemical elements from stars, of various initial masses and metallicities, via stellar winds and supernovae. This new scheme enables a much more detailed study of the chemical evolution of galaxies, and enables a comparison with a larger range of observational data. In Chapter 5, I demonstrate that this new model is able to simultaneously reproduce the chemical properties observed in a) the gas of local, star-forming galaxies, b) the photospheres of G dwarfs in the Milky Way disc, and c) the integrated stellar populations of nearby elliptical galaxies. Furthermore, the model is able to do this without any significant deviation from the standard framework of galaxy formation in the canonical paradigm of hierarchical structure formation. This can be seen as a significant achievement, which has allowed us to form a much more comprehensive view of GCE than was possible before.