This might seem like a silly answer, but it's because "pit" is a word that is both a noun and a verb.
* Noun: A hole in the ground, a depression, a seed of a fruit.
* Verb: To remove the stones from a fruit.
So, depending on the context, "pit" can be used as both the word and its homophone.
Let me know if you'd like to explore other homophones for different words!