"Rival" vs. "foe": close contenders or fierce enemies?

What is similar?
Both "rival" and "foe" refer to an opponent or someone in opposition. They can describe entities that are competing or in conflict.
What is different?
"Rival" typically refers to a competitor striving for the same goal, sometimes implying a sense of mutual respect or friendly competition. "Foe" refers to an enemy or adversary, often implying hostility or animosity without the competitive aspect.
Which one is more common?

Examples of usage
Rival- The two runners were rivals throughout their athletic careers.
- The company is trying to outdo its biggest rival in the industry.
- She finally surpassed her rival in academic achievements.
- The knight bravely battled his foe.
- In the game, players must defeat numerous foes to advance.
- The politician saw anyone who opposed him as a foe.