By and large, languages avoid having multiple words with the same meaning. This makes sense from the point of view of economy: why learn two words when one will do the job?
But occasionally there are exceptions, such as warranty and guarantee. This is one of several synonymous or near-synonymous pairs of words in English conforming to the same pattern – another example is guard and ward. The variants with gu- represent early borrowings from Germanic languages into the Romance languages descended from Latin. At the time these words were borrowed, the sound w had generally developed into v in Romance languages, but it survived after g, in the descendants of a few Latin words like lingua ‘tongue, language’. So when Romance speakers adapted Germanic words to the sounds of their own language, gu was the closest approximation they could find to Germanic w.
This is why French has some words like guerre ‘war’, where gu- corresponds to w- in English (this word may have been borrowed because the inherited Latin word for war, bellum, had become identical to the word for ‘beautiful’). Later, some of the words with gu- were borrowed back into English, which is why we have both borrowed guard and inherited ward. According to one estimate, 28.3% of the vocabulary of English has been borrowed from French (figures derived from actual texts rather than dictionaries come in even higher at around 40%), a debt that we have recently started repaying in earnest with loans like le shopping and le baby-sitting. This is all to the consternation of the Académie française, which aims to protect the French language from such barbarisms, as evidenced by the dire, ne pas dire (‘say, don’t say’) section of the académie‘s website advising Francophones to use homegrown terms like contre-vérité instead of anglicisms like fake news.
In fact, warranty and guarantee reflect not one but two different waves of borrowing: the first from Norman French, which still retained the w- sound, likely through the influence of Scandinavian languages spoken by the original Viking invaders of Normandy. Multiple layers of borrowing can also be seen in words like castle, from Latin castellum via Norman French, and chateau, borrowed from later French, in which Latin c- had developed a different pronunciation.
Incidentally, Norman French is still continued not only in Normandy but also in the Channel islands of Guernsey, Jersey and Sark. The Anglo-Norman dialect of the island of Alderney died out during World War II, when most of the island’s population was evacuated to the British mainland, although efforts are underway to bring it back.