The H-mode is a confinement mode of toroidal plasmas, which may make the goals of fusion possible—the development of a clean energy source at competitive electricity costs. The most challenging aspect of the H-mode physics is the sudden disappearance of the edge turbulence whereas its driving forces—the gradients—increase. As the physics behind the H-mode is subtle many features are not yet clarified. There is, however, substantial experimental and theoretical evidence that turbulent flows, which normally limit the confinement, are diminished by sheared poloidal flow residing at the plasma edge. There are many conceivable mechanisms giving rise to sheared flow. The most intriguing of these is that fluctuations themselves induce the flow, which acts back to its generating origin and annihilates the turbulence. This review concentrates mostly on the transition physics, describes one line of understanding the H-mode in more detail, recalls some of the older observations and summarizes the achievements in the H-mode for both tokamaks and stellarators.