The electronic and optical properties of matter are determined by the quantum-mechanical behaviour of the electrons inside the solid. As the electrons carry a negative electric charge and hence influence each other through their mutual Coulomb interaction, collective phenomena play a crucial role in this context. An example is the occurrence of excitons and plasmons in optical spectroscopies. The aim of many-body theory is to understand these correlation mechanisms and to describe how they lead to the observed macroscopic properties of a material. For this purpose we only draw on the fundamental laws of quantum mechanics, without using empirical parameters, so that the numerical results possess true predictive power. Our most important mathematical tools are many-body perturbation theory and time-dependent density-functional theory, which allow an accurate quantitative calculation of electronically excited states, including their dynamics and the interaction with external electromagnetic fields.