What determines how an atom reacts with other atoms?