Her and Heir are easily confused words.
The spell-check application of most word processing software programs would not catch a slip-up of these two words. Spell-check is looking for words that aren’t in its dictionary, and words that resemble words in its dictionary but are possibly spelled wrong. Spell-check isn’t perfect. It doesn’t know and can’t guess what word you wanted or what word you meant, it can only judge the words on the page. If you used words that are all spelled correctly, it gives you a pass anyway.
Autocorrect suggests words that start with the same letters. It suggests what word you may want to save time, but quite often, its suggestions couldn’t be more off base and produces humorous results.
Her is a noun, it is the objective case for a female. In sentences, it is used when a female possesses something, or is receiving something: I gave her book back yesterday. Her jacket is on the chair. That’s her over there.
Heir is a noun. The heir is the prince or princess next in line for a throne once the current monarch dies. In England, the heir is Prince Charles. In Japan, it’s Prince Naruhito.
The following sentence uses both words correctly:
Hersilia was beside herself with rage about the limited attitudes of her times: why couldn’t women ascend to the throne, why did heirs have to be male?