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 the same six neutral patches, a linear ratio of 42 to 1 comes out as 187 against 14 code values. Measured here — a single exponent misses by 9.6 code values, because the curve is a gamma with a contrast S stacked on it.

More in the image itself