Karbala was at first an uninhabited place and did not witness any construction activity, although it was rich in water and its soil fertile.
Following the tenth of Muharram 61 AH (680 AD), after the martyrdom of Imam Husayn [a], people from far as well as tribes living nearby started visiting the holy grave.
A lot of those who came, stayed behind and/or asked their relatives to bury them there after their demise.
Despite many attempts by successive rulers, such as Al-Rashid and Al-Mutawakkil, to put a restriction on the development of this area, it has nonetheless spread with time to become a city.
source : http://www.al-islam.org