The process in which atoms gain or lose electrons and thus become ions with positive or negative charges; sometimes used as synonymous with dissociation, the separation of molecules into charged ions in solution.