The chemical composition of the Universe has evolved over billions of years. A host of astrophysical processes and observations must be understood in order to explain why celestial objects have the chemical compositions observed. This book contains the lectures delivered at the XIII Canary Islands Winter School of Astrophysics, which was dedicated to reviewing current knowledge about the origin and evolution of the chemical elements in the Universe. Written by seven prestigious astrophysics researchers, it covers cosmological and stellar nucleosynthesis, abundance determinations in stars and ionised nebulae, chemical composition of nearby and distant galaxies, and models of chemical evolution of galaxies and intracluster medium. This is a timely review of developments in cosmochemistry over the last decade.