A microscopic explanation for type inversion and the annealing behaviour of radiation damaged silicon detectors