A purely toroidal magnetic field is stronger on the inner side of the torus and its field lines are curved. The resulting magnetic gradient drift and curvature drift move ions and electrons vertically in opposite directions. Charge separation can then produce an electric field whose E-cross-B drift moves the plasma across the nominal toroidal confinement region. Closing field lines into circles therefore does not by itself guarantee confinement.
A tokamak combines a strong externally produced toroidal field with a poloidal field supplied largely by toroidal plasma current. Field lines wind helically around nested magnetic flux surfaces. A particle following a field line samples different vertical and radial parts of the torus, so the systematic displacements associated with the toroidal geometry can compensate over its orbit rather than accumulating as in the pure-toroidal case. The poloidal field also provides the magnetic structure needed for force balance. This improves confinement but does not eliminate all orbit losses or transport: trapped particles, collisions, turbulence and magnetohydrodynamic instabilities remain important. Maintaining the plasma current and suitable field-line winding is part of the confinement problem.