This is an account of the theory of JSJ decompositions of finitely generated groups, as developed in the last twenty years or so.We give a simple general definition of JSJ decompositions (or rather of their Bass-Serre trees), as maximal universally elliptic trees. In general, there is no preferred JSJ decomposition, and the right object to consider is the whole set of JSJ decompositions, which forms a contractible space: the JSJ deformation space (analogous to Outer Space).We prove that JSJ decompositions exist for any finitely presented group, without any assumption on edge groups. When edge groups are slender, we describe flexible vertices of JSJ decompositions as quadratically hanging extensions of 2-orbifold groups.Similar results hold in the presence of acylindricity, in particular for splittings of torsion-free CSA groups over abelian groups, and splittings of relatively hyperbolic groups over virtually cyclic or parabolic subgroups. Using trees of cylinders, we obtain canonical JSJ trees (which are invariant under automorphisms).We introduce a variant in which the property of being universally elliptic is replaced by the more restrictive and rigid property of being universally compatible. This yields a canonical compatibility JSJ tree, not just a deformation space. We show that it exists for any finitely presented group.We give many examples, and we work throughout with relative decompositions (restricting to trees where certain subgroups are elliptic).