Lens corrections are applied to only the raw file. The idea is that the camera manufacturer often already corrects the jpeg, but that is not necessarily always the case. And if the manufacturer does correct the jpegs, then this correction is done with the manufacturer’s profile while the raw file is corrected with Adobe’s profile. That can make a difference.
Johan, I've always been curious about this, and I've seen it explained on DPR MF Board different ways by different people, but let's tale Fuji for instance with their GFX cameras and Fuji GF lenses. I was told that Fuji apples certain correction (various types of known distortion and aberrations) to the GF lens lineup (each lens differently) and writes those in camera to the raw file and the in-camera jpegs that are produced. Adobe then has the option of whether or not to honor those corrections. Adobe works with Fuji and LR reads the Fuji-provided correction and when you open the raw file, the corrections are there. In the lens correction panel, you see as default the lens name and camera make and the "enable profile corrections" box is checked. I remember one guy told me that you can't turn these corrections off. They are automatically applied. Bust played around with a bunch of previously edited files and switching off the enable profile correction button seems to do nothing with any kind of distortion but the histo does change and the image seems to go about a third-stop darker.
Anyway, these software corrections are important because they allow Fuji to design their lenses and make compromises in weight, size and price while correcting the known fault (such as some barrel distortion with the very expensive GF 23 mm) with software and have those corrections honored by the post processing software (LR).
But I have been told that you cannot turn off the lens corrections that were baked into the raw by Fuji and honored by LR, despite the ability to switch off the enable profile button.
Now with Leica it seems a bit different. I know that Leica writes corrections to the raw file on the Q2 and that amazing 28 mm Summilux F1.7, When the Leica Q2 DNG files are imported, LR honors the Leica baked-in corrections to the 28 mm Summilux and it says "Built in" on the lens profile and you can't turn it off in LR to see the difference. You can turn off the enable lens profile switch, but it does nothing. At the bottom of the panel, it says "Built-in lens profile applied," and you can't change that in LR.
When you click on that information button, LR tells you that the built-in Leica lens profile was applied automatically and corrects chromatic aberration and lens distortion.
With the Fuji raw files, the info item like that does not display at the bottom of the panel, but the various GF lenses (I have them all) are displayed in the lens prfile make and model.
I was always told on the Fuji and Medium Format DPR Boards that LR honors those corrections, and you can't turn them off. But I'm not sure.
I probably have some of that wrong, but those lens profiles are baked in the raw and honored by LR for Fuji and Leica.