Magnetic flux is a measure of the magnetic field lines passing through a surface, such as a loop of wire. The magnetic flux through a closed surface such as a sphere is always zero, because the magnetic field lines going into the closed surface are balanced by field lines coming out.