It's a feature found in many word processing programs and web browsers, designed to help users identify potential grammar mistakes.
While it's a helpful tool, it's not foolproof. Sometimes the red underline may be wrong, and it's always important to double-check your work!