Surface tension is ultimately a property of liquids that stems from their cohesion, or the attractive forces between molecules of that liquid. Take water, for instance. A partially positive hydrogen atom in one molecule of water may temporarily bond to a partially negative oxygen atom in another, leading to a substantial cohesive force. Cohesion and surface tension may also result from the effects of dipole-dipole attraction in polar molecules, as in ammonia, although to a slightly smaller degree.
On the other hand, nonpolar molecules which don’t experience the effects of hydrogen bonding, like liquid nitrogen, are generally not attracted to one another except via London dispersion forces, which result in weak cohesion and, thus, weak, but nonzero, surface tension. Because of these London dispersion forces, all liquids have surface tension to some degree at normal pressures.