Typically caused by a bad connection at either end of the laptop screen's ribbon cable, or the cable may be damaged. That's why an external monitor is not affected as the cable is used only for the built-in screen.
The cable is obviously internal so some disassembly will be required to get at it. If cable is damaged, new ones are readily available online.