Compact binary mergers involving neutron stars can eject a fraction of their mass to space. Being extremely neutron rich, this material undergoes rapid neutron capture nucleosynthesis, and the resulting radioactivity powers fast, short‐lived electromagnetic transients known as kilonova or macronova. Such transients are exciting probes of the most extreme physical conditions and their observation signals the enrichment of the Universe with heavy elements. Here the current understanding of the mass ejection mechanisms, the properties of the ejecta, and the resulting radioactive transients are reviewed. The first well‐observed event in the aftermath of GW170817 delivered a wealth of insights, but much of today's picture of such events is still based on a patchwork of theoretical studies. Apart from summarizing the current understanding, questions where no consensus has been reached yet are also pointed out, and possible directions for the future research are sketched. In an appendix, a publicly available heating rate library based on the WinNet nuclear reaction network is described, and a simple fit formula to alleviate the implementation in hydrodynamic simulations is provided.