The role of electronically excited states in recombination reactions