It will surprise no one that the history of the word rival involves several duos.
The first is strictly lexical. Rival is from a Latin word that has two forms. Rivalis the adjective isn't terribly interesting: it means "of a brook or stream." (It's predictably—for Latin students—a derivative of rivus, meaning "brook or stream.") Rivalis the noun is a bit more complicated. For one thing, it only occurs in plural forms. And for another thing, it refers not to a brook or stream but to something with a lot more potential for drama: those who use the same stream as a source of water.
Those Latin rivals did not, it seems, have the easiest time with sharing. The linguistic detritus they left behind suggests they competed not just over water sources but eventually over love as well. The rivalis that both the English and French languages borrowed was all about rivals in love. Current available evidence points to the English word's entrée into the language sometime around 1577. Shakespeare used the word like it had nary a thing to do with banal things like stream sharing:
My foolish rival, that her father likes / Only for his possessions are so huge, / Is gone with her along; and I must after, / For love, thou know'st, is full of jealousy.
— Two Gentlemen of Verona, 1623
The English word rival did not let its amatory applications limit its use. It proved quite useful, in fact, for other kinds of competition. It referred to any two (or more) striving to reach or obtain something that can really only belong to one. It later developed a meaning referring to one striving for competitive advantage, but not before it developed a meaning like "equal" or "peer," as in "a writer without rival."
If all this talk about rivalis and brooks and streams has you concluding that there was some begetting involved with rivalis and the English word river, we must inform you that the words are unrelated. River comes ultimately from the Latin word ripa, meaning "bank" or "shore."