A part of speech (POS) tagger analyzes a piece of text, such as a sentence, and determines each individual word's POS in the context of the sentence. The only way to accomplish this is with a dictionary lookup, so it is not an algorithm that can be developed from first principles alone.
A great use case for POS tagging is intent extraction from commands. For instance, when you say Siri, please order me a pizza from John's pizzeria, the AI system will tag the command with parts of speech in order to extract the subject, verb, object, and any other relevant details from the command.
Additionally, POS tagging is often used as a supporting tool for other NLP operations. Topic extraction, for instance, makes heavy use of POS tagging in order to separate people, places, and topics from verbs and adjectives.
Keep in mind that POS tagging is never perfect...