The curve between light and code value

Raw counts are proportional to the light that arrived; a developed file is not. This is the curve in between — drag it and the image and its histogram re-render together.

Try this

Compare the straight line against a gamma curve at the same exposure. The midtones move a long way while the ends barely shift, which is why 18% grey does not land at 18% of 255.

Where this lab comes from

The Camera Response Curve: Why Your JPEG Is Not Proportional to Light

Raw counts are proportional to the light that arrived. The developed file is not: on six neutral patches, a 42:1 ratio of light comes out as 187 against 14 code values. Measured here, the file sits a mean 9.6 code values off the sRGB curve, and the BT.709 curve the developer applied by default accounts for most of that.

More in the image itself