The words gild, gilled, guild sound the same but have different meanings and spellings. Why do gild, gilled, guild sound the same even though they are completely different words?
The answer is simple: gild, gilled, guild are homophones of the English language.
To cover with or as if with a thin layer of gold.
To give an often deceptively attractive or improved appearance to.
Archaic To smear with blood.
gild the lily To adorn unnecessarily something already beautiful.
Having gills
An association of persons of the same trade or pursuits, formed to protect mutual interests and maintain standards.
A similar association, as of merchants or artisans, in medieval times.
Ecology A group of diverse species, especially animal species, that occupy a common niche in a given community, characterized by exploitation of environmental resources in the same way.
Definitions from The American Heritage® Dictionary of the English Language, 4th Edition, from Wiktionary, Creative Commons Attribution/Share-Alike License 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").