Excitation and loss processes of ions at surfaces