The words metal, mettle sound the same but have different meanings and spellings. Why do metal, mettle sound the same even though they are completely different words?
The answer is simple: metal, mettle are homophones of the English language.
Any of a category of electropositive elements that usually have a shiny surface, are generally good conductors of heat and electricity, and can be melted or fused, hammered into thin sheets, or drawn into wires. Typical metals form salts with nonmetals, basic oxides with oxygen, and alloys with one another.
An alloy of two or more metallic elements.
An object made of metal.
Basic character; mettle.
Courage and fortitude; spirit: troops who showed their mettle in combat.
Inherent quality of character and temperament.
on (one's) mettle Prepared to accept a challenge and do one's best.
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").