The magnetic field is produced by moving electric charges. Unlike gravitational or electrostatic fields, it has no sources or sinks. Its lines of force are therefore closed and continuous throughout space, which means that the magnetic flux through any closed surface is always zero. This is Gauss's law for the magnetostatic field.
Ampère's law lets us calculate the magnetic field produced by a current. We apply it to an infinite cylindrical conductor, that is, the typical wire or cable. It is taken as infinite to keep things simple; otherwise the calculations become much more complex. So we focus on a conductor with ideal properties (solid, homogeneous density and infinite length).
We want to find B at a distance r from the centre of the conductor (of radius R); in most cases r can be taken as the radial distance from the surface of the conductor. The resulting field is tangential and constant at distance r, as long as the medium is also homogeneous, in this case a vacuum, which is why we use the permeability of that medium \( \mu_0 \).
This gives the following graph. The field we are most interested in is the one outside the conductor.