It's almost always a hardware problem that won't go away without some sort of part replacement. Most often it's a damaged digitizer - the component on the front screen assembly that converts touch into digital inputs to report contact with the screen. Rarely it might be damage to the touch control chip on the logic board, or maybe a loose solder connection. The iPhone 6 Plus was notorious for that because the solder connections would break from flexing since they apparently didn't use a filler material - not sure what the technical term is - between the board and the chip package.
But the most common reason is a bad digitizer. That's easy to fix with just a front screen assembly replacement, including a new display. The front glass and digitizer are fused to the display, so Apple doesn't fix that separately.
Apple running a diagnostic might be possible to determine the exact cause.