Consider a closed surface encompassing a bar magnet. According to Gauss's law for magnetism, the magnetic flux emerging from the North pole of the magnet will be:
Since the net magnetic flux through any closed surface is zero, any magnetic flux emerging from the North pole (considered positive) must be balanced by an equal amount of magnetic flux entering the South pole (considered negative) within the same closed surface. This is a direct consequence of magnetic field lines forming closed loops.