It's worth looking at a gamma chart for additional perspective as you think about this. Standard display gamma, for example, is 2.2. The curve looks like this:
50% grey, in an 8-bit space, is 127 (horizontal axis). This lines up with ~20% luminance output of the display. Both for display and print the concept of gamma is important as it provides the mapping, or conversion, between the linear (camera/image) data and the logarithmic sensitivity of the human eye.
The human eye can resolve something on the order of 10-14 f-stops of dynamic range at a fixed pupil size. This is up to ~3 stops better than the best DSLRs shooting in 14-bit RAW. Our brain is also capable of using all of that data at once - it's like we have a 16-bit RAW image processor built into our visual cortex[*] and it automatically adjusts the highlight and shadow levels, etc, to get a perfect exposure in real time. ~18% grey is just an empirical value that fits the processing that our eyes will naturally apply to the scene they see.
It is empirical because it works and looks mid-grey in a typical scene. The eye is easily fooled, however, and is extremely context sensitive. The brain will mercilessly photoshop what the eyes see in order to try to make sense of it and greys are routinely imagined to be any shade that makes sense to us. The classic illusion of this is this :
B squares are identical in brightness. So, yes, the eye is extremely non-linear and, furthermore, is not even uniform in its rendering over our visual field. Darks are brightened, brights are darkened, and the entire scene is heavily compressed into a narrow perceptual range that we can extract detail from.
When shooting high dynamic range scenes this is intuitive, I think, to photographers - we really have to work in post to balance a high dynamic range scene into a form that appears similar to what the eye perceives. When we can control the light, we add LOTS of it - fill, fill, fill. Getting a balanced colour photo that doesn't need a lot of post requires that we add as much light as possible to fill in the dark areas of the scene - reducing the dynamic range as much as possible to produce a scene that is flatter and more uniformly lit (just like our brain tries to do with the scenes we see).
To answer the comment below, this is taken from the image above to make the point :
[*] To be more precise, for those who wish it, some of the initial image processing and compression is done by several layers of specialized cells directly behind the retina before the information is sent to the brain.