I review the recent progresses that have been obtained, especially through the use of high-resolution numerical simulations, on the dynamics of self-gravitating accretion discs. A coherent picture is emerging, where the disc dynamics is controlled by a small number of parameters that determine whether the disc is stable or unstable, whether the instability saturates in a self-regulated state or runs away into fragmentation, and whether the dynamics is local or global. I then apply these concepts to the case of AGN discs, discussing the implications of such evolution on the feeding of supermassive black holes. Nonfragmenting, self-gravitating discs appear to play a fundamental role in the process of formation of massive black hole seeds at high redshift ( 10–15) through direct gas collapse. On the other hand, the different cooling properties of the interstellar gas at low redshifts determine a radically different behaviour for the outskirts of the accretion discs feeding typical AGNs. Here the situation is much less clear from a theoretical point of view, and while several observational clues point to the important role of massive discs at a distance of roughly a parsec from their central black hole, their dynamics is still under debate.