A digital picture is in my opinion only a sequence of pixels. e.g. in the .png format (simply explained) for each pixel, the color value and its position is stored.

So how big a digital image is displayed on the screen depends on how many pixels the screen has and how the operating system (or software) handles the image. (On a 1080p monitor, an image is displayed "larger" at 100% than on a 4K monitor of the same size, since the latter has denser pixels - due to more pixels/area).

If a digital image is now to be printed, then the printing software (having information about the printer) decides with which resolution (e.g. 300 dpi) the image will be printed on the paper.

The real problem:

In Lightroom Classic, there is an option in the export dialog called "Image Sizing" where you can set the resolution in ppi. But I absolutely don't understand how this setting will affect the image. After all, it is still only pixels and their color value that are stored digitally.

The number of pixels per inch is different for each device (due to the hardware). The number of pixels per inch is not determined by the image format, but by the software that handles the display (print or on the screen).

So what is this option in Lightroom good for?