Permanent magnets (or ferromagnets) exhibit a magnetic field even in the absense of an applied external field (unlike diamagnetism and paramagnetism). This is called spontaneous magnetization (SM).
SM is due to alignment of permanent dipoles within the material. The dipoles themselves exist due to contributions from the orbital angular momentum of charged particles (for eg., an electron orbiting a nucleus is equivalent to a current flowing, which generates a dipole moment according to Ampere's Law) and the intrinsic angular momemtum, or spin
Magnets have magnetic field is that when electrons in each atom align predominately in one direction, say in clockwise direction, then current flows in anti-clockwise direction. And by right hand grip rule, we can know the direction of the magnetic field produced