The words coax, cokes sound the same but have different meanings and spellings. Why do coax, cokes sound the same even though they are completely different words?
The answer is simple: coax, cokes are homophones of the English language.
To persuade or try to persuade by pleading or flattery; cajole.
To obtain by persistent persuasion: coaxed the secret out of the child.
Obsolete To caress; fondle.
To move to or adjust toward a desired end: "A far more promising approach to treating advanced melanoma is to coax the immune system to recognize melanoma cells as deadly” ( Natalie Angier).
A simpleton; a dupe.
Plural form of coke.
Third-person singular simple present indicative form of coke.
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").