The origin and nature of intrinsic toroidal plasma rotation in the scrape-off-layer (SOL) of tokamaks is investigated both analytically and through numerical simulations. It is shown that the equilibrium poloidal E x B flow, the sheath physics, and the presence of poloidal asymmetries in the pressure profile act as sources of momentum, while turbulence provides the mechanism for the radial momentum transport. An equation for the radial and poloidal dependence of the equilibrium parallel ion flow is derived, and a simple analytical solution is presented. This solution reproduces and explains the main experimental trends for the Mach number found in the SOL of tokamaks. Global, three-dimensional fluid simulations of SOL turbulence in different limiter configurations confirm the validity of the analytical theory.