The Aghlabids and Fatimids improved Tunisia’s religious, cultural, and architectural scene. They built key monuments, like the Great Mosque of Kairouan.