This review discusses the heavy-fermion superconductivity in Ce- and U-based compounds crystallizing in the body-centered tetragonal ThCr2Si2 structure. Special attention will be paid to the theoretical background of these systems which are located close to a magnetic instability.