It has its name from the the city Kairouan in Tunisia. Either there was a woman with the origin in Kairouan who established it, or it simply got its name from the quarter where immigrants of this town lived.
Kairouine mosque has been the centre of Islamic learning in Morocco for more than 1000 years, but its real growth to importance came in the 10th and 12th centuries, when most of its structures were added to to the rather modest original structures.
As a mosque it is rather unusual. Its large quarters have since long grown together with the rest of Fez, and unless you enter it, it is therefore almost impossible to get a grip of its real size. Fortunately there are sometimes doors open that allows non-Muslims to look inside, so that they can at least make a guess.
But even if you cannot enter the mosque, at least many of the Islamic schools that lies around it are open to visitors. The most famous of these is the Attarin madrasa.