The words guarantee, guaranty sound the same but have different meanings and spellings. Why do guarantee, guaranty sound the same even though they are completely different words?
The answer is simple: guarantee, guaranty are homophones of the English language.
Something that assures a particular outcome or condition: Lack of interest is a guarantee of failure.
A promise or an assurance, especially one given in writing, that attests to the quality or durability of a product or service.
A pledge that something will be performed in a specified manner.
A guaranty by which one person assumes responsibility for paying another's debts or fulfilling another's responsibilities.
An agreement by which one person assumes the responsibility of assuring payment or fulfillment of another's debts or obligations.
Something given as security for the execution, completion, or existence of something else.
The act of providing such security.
A guarantee, as for a product or service: a new refrigerator still under guaranty.
Definitions from The American Heritage® Dictionary of the English Language, 4th Edition and Wordnik.
Homophones (literally "same sound") are usually defined as words that share the same pronunciation, regardless of how they are spelled.
If they are spelled the same then they are also homographs (and homonyms); if they are spelled differently then they are also heterographs (literally "different writing").