When elements react, their atoms join with other atoms to form compounds. Chemical bonds form when this happens, which involves atoms transferring or sharing electrons.