Molecular compounds such as water exist as discrete particles, molecules. This is due to the forming of covalent bonds where each atom has a specific partner to which it is bonded. Each molecule of water contains one atom of oxygen and two atoms of hydrogen. So, H2O is its formula. This can be more specifically called a molecular formula.
In ionic compounds such as table salt, NaCl, the atoms (as ions) do not bond to specific neighbors. Surrounding each chloride ion in a salt crystal are six sodium ions. Likewise, six chloride ions surround each sodium ion. This attraction of oppositely charged ions extends throughout the entire crystal. There is no discrete bonding of a particular sodium ion to a specific chloride ion. So the formula for sodium chloride is expressed as the smallest whole number ratio between the Na and Cl ions which is 1:1 for sodium chloride. So, NaCl is also a formula but not a molecular formula.
The reason for the term "formula unit" is that it is useful when we talk about how much of one substance is required to combine with a particular amount of another substance. For example: to make the smallest amount of hydrogen carbonate we combine one molecule of water with one molecule of carbon dioxide.
But now suppose we want to combine silver nitrate with sodium chloride. Both of these are ionic compounds, they do not form molecules. In this case you would say that one formula unit (FU) of sodium chloride combines with one FU of silver nitrate.
The one-to-one combining in both these examples is simply coincidence. It may take 3 FUs of substance A to combine exactly with 2 FUs of substance B in a different example.