Warranty is the Norman form of what Parisian French made into guarantee. English took warantie in the mid-1300s from Anglo-French and Old North French, where the initial w had been preserved; the central French version of the same word had turned that w into gu-, and English borrowed that too, three centuries later, as guarantee.
The pair is now split by function rather than meaning: a warranty is a term in a contract, a guarantee is a promise or the person making it, and no English speaker could derive the distinction from the words themselves. It is pure historical accident — two dialects, two dates, two spellings, and then lawyers assigning them different work. Warden and guardian are the same story, as are warrant and guarantor.
warranty (n.) mid-14c., warantie , a legal term for various types of clauses in real estate transactions, from Anglo-French and Old North French warantie "protection, defense, safeguard" (Old French garantie ), from warant (see warrant (n.)). Also sometimes as "authority, mandate, warrant" (early 15c.). also from mid-14c.