Massive black holes weighing from a few thousands to tens of billions of solar masses inhabit the centers of today's galaxies, including our own Milky Way. Massive black holes also shone as quasars in the past, with the earliest detected a mere one billion years after the Big Bang. Along cosmic time, encounters between galaxies hosting massive black holes in their centers have produced binary massive black holes that eventually coalesced by emission of gravitational waves. I will discuss the physical processes through which massive black holes pair and bind, present the analysis of cosmological simulations to investigate the properties of merging massive black holes and their host galaxies and conclude with how we can use gravitational wave observations with ESA's planned satellite LISA to constrain the evolving population of massive black holes.