They have been providing things like courts, health clinics, emergency food relief and other government or pseudo-governmental services in at least some of the areas they control, particularly in Syria - it is part of what is helped them create or maintain legitimacy.