We discuss the origin of ferromagnetism in dilute magnetic semiconductors based on ab initio calculations for Mn-doped GaN, GaP, GaAs and GaSb. We use the Korringa–Kohn–Rostoker method in connection with the coherent potential approximation to describe the substitutional and moment disorder. Curie temperatures (TC) are calculated from first-principles by using a mapping on a Heisenberg model in a mean field approximation. It is found that if impurity bands are formed in the gap, as it is the case for (Ga, Mn)N, double exchange dominates leading to a characteristic √c dependence of TC as a function of the Mn concentration c. On the other hand, if the d-states are localized, as in (Ga, Mn)Sb, Zener's p–d exchange prevails resulting in a linear c-dependence of TC. In order to have more precise estimations of TC, effective exchange coupling constants Jij's are calculated by using the formula of Liechtenstein et al. It is found that the range of the exchange interaction in (Ga, Mn)N is very short. On the other hand, in (Ga, Mn)As the interaction is weaker but long ranged. Monte Carlo simulations show that the TC values of (Ga, Mn)N are very low since percolation is difficult to achieve for small concentrations and the mean field approximation strongly overestimates TC. Even in (Ga, Mn)As the percolation effect is still important.