Everything in the universe is made up of matter, and matter is composed of a combination of elements. An atom is the smallest unit of an element that retains all properties of the element. For example, a silver coin is made up of silver atoms, and each silver atom retains the unique properties of the element — silver.
Elements are pure substances consisting of identical atoms that cannot be broken down into simpler substances by chemical changes. Atomic elements contain single atoms as their basic unit. Carbon is composed of carbon atoms, and sodium is composed of sodium atoms. Most elements are atomic elements. There are, however, a few elements that exist as a combination of atoms, and are never found in nature as single atoms. These are called molecular elements. Molecular elements exist as molecules with two or more atoms bonded together. They can be diatomic, like hydrogen (H2), oxygen (O2), or chlorine (Cl2) gas, or polyatomic, like sulfur (S8) and phosphorous (P4).
A molecule consists of two or more atoms joined by strong forces called chemical bonds. A molecule may consist of two or more identical atoms, or it may consist of two or more different atoms. When the molecule consists of atoms from two or more different elements that are combined in fixed whole number ratios, the molecule is also a compound. For example, water is a compound, and each water molecule (H2O) is a unit that contains two hydrogen atoms and one oxygen atom. The molecule glucose (C6H12O6) is also a compound that contains six carbon atoms, twelve hydrogen atoms, and six oxygen atoms.
Compounds are pure substances composed of two of more elements in fixed, definite proportions. Compounds are classified as molecular or ionic based on the bonds present.
The nature of the attractive forces that hold atoms together within a compound decides the type of chemical bond formed. The complete transfer of electrons between a metal atom and a nonmetal atom results in the formation of oppositely charged ions. The electrostatic attraction between the ions is called an ionic bond, and the compounds formed through ionic bonds are ionic compounds. For example, sodium chloride NaCl is an ionic compound.
The sharing of electrons between two or more nonmetal atoms results in covalent bonds, and the compounds formed through covalent bonds are called covalent or molecular compounds. Covalent bonds are the attractive forces between the positively charged nuclei of the bonded atoms and negatively charged electrons shared between the atoms.
This text is adapted from OpenStax Chemistry 2e, Section 2.6: Molecular and Ionic Compounds.