Principles and Applications of Chemical Defects