They're created during a chemical reaction where atoms are rearranged into new compound molecules. For example, if carbon atoms react with oxygen atoms they form carbon dioxide molecules.