The words prier, prior sound the same but have different meanings and spellings. Why do prier, prior sound the same even though they are completely different words?
The answer is simple: prier, prior are homophones of the English language.
One who pries, especially a person who is unduly interested in the affairs of others.
Preceding in time or order: "[They] insist that foreign vessels seeking access obtain prior approval” ( Seymour M. Hersh).
Preceding in importance or value: a prior consideration.
A monastic officer in charge of a priory or ranking next below the abbot of an abbey.
One of the ruling magistrates of the medieval Italian republic of Florence.
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").