They are generally there to prevent a sudden and "unpredictable" loss of air flow over a surface. This will therefore normally reduce the stall speed and/or give more benign stalling charactistics. An aircraft with loads of them sticking out all over the place normally shows and aircraft designed with a (too small) budget which gets totally blown away away when the flight trials begin.