Imagine a current loop perpendicular to the screen pointed up and down with the current flowing out of the top end. Next to it, imagine a flat permanent magnet lying in the plane the screen with the north end on the right side and the south end on the left side. Why does the magnetic field created by the loop and magnet have the same shape? My level of physics knowledge is that of a first-year undergraduate in physics, but would like an answer both on my level and an indication of where to look in future studies for a deeper understanding.
A permanent magnet owes its magnetic field to microscopic currents. If you imagine each tiny current as a circular one laying in a plane such as in the picture below, you will see that the currents immediately facing each other are going in opposite directions and therefore cancel out.
What is left is just the surface current that seems to flow on the outside of the bar magnet. It is then clear that such a current distribution produces the same magnetic field as a circular loop in a wire.