Something that appears on the screen but not in screenshots means a physical problem with the screen (a screenshot is an image of what the phone sends to the screen rather than what the display panel actually shows). So the obvious answer is what's often called "burn in", where the phone has spent a lot of time displaying the same image and it has left a permanent impression on the screen. It's most likely to happen if you have one static element on the display for a long time, especially if the screen is running at high brightness (so for example if you commonly spend many hours using the phone for navigation with the brightness high then some static part of the user interface might do this). As it's a physical degradation of the LEDs themselves there is nothing you can really do if it does happen.
The reason behind this is that OLEDs degrade with use, and lose brightness as they age. Generally this process is uniform across the display, but if you have a bright image that is displayed for a large fraction of the time you use the phone (especially if it's a large fraction of the time that you use it at high brightness) then that bit of the display can lose brightness faster than the rest, resulting in a negative image that's visible at all times (especially against uniform backgrounds). It's really a "burn out" rather than a "burn in", but the name (which dates back to older display technologies like cathode ray tubes or plasma displays) has stuck.
I've never had that happen with any of my OLED phones, and I typically keep them for 4-5 years. But I have seen it in shop display models, which can sit for weeks or months at full brightness showing the same images.