"Enemy" is the basic, normal, common, everyday word.
"Foe" is old-fashioned and literary. It is, however, part of the everyday expression "friend or foe?"
The word "adversary" is formal, technical, and a little softer than "enemy." It is diplomatic language. It does not necessarily carry the idea of war and killing. In a court of law, the lawyers on opposing sides are not really enemies. They would not shoot each other! But they are "adversaries," they are struggling against each other on opposite sides.
The word "rivals" means two people (or companies or nations) who are competing against each other for the same thing. The two teams in a football game are not enemies, not foes, not adversaries--but they are rivals. The United States and China are economic rivals. Two women who are trying to marry the same man can be called "rivals."
"Foe" is often used in English poetry because it is a short, strong, one-syllable word that rhymes easily:
"I was angry with my friend;
I told my wrath, my wrath did end.
I was angry with my foe:
I told it not, my wrath did grow."
That's from a poem by William Blake, 1757–1827. It would be very hard to fit the words "enemy" (or "rival" or "adversary") into this poem!