This was a great question. When you come inside after playing in the sunny outside, why is it so dark?
Simple answer: because your eyes are smart. When you are outside, there is a lot of light. Really, it is too much light. To compensate for this, your pupils (the part of your eye that light goes through) closes some. And then, when you go back inside your pupils are still small. Inside (even with the lights on) is not nearly as bright as outside. Not enough light is getting through your pupils and so everything looks "dark".
Here is a simple demo. While inside, take a flashlight (not too bright - just a plain one) and shine it in someones eye. Watch the eye and you can see the pupil get smaller. I showed this to some kids and they thought it was awesome. Here is a video.
As Ben Goldacre would say "I think you'll find it's a bit more complicated than that".
Pupil reactions are part of the story, but there's some other equally awesome anatomy, biochemistry and neurophysiology involved.
The diameter of a typical young person's pupil varies from about 2mm in bright light to about 8mm in the dark (older people's pupils don't dilate quite as much in the dark). Since the amount of light entering the eye depends on the area of the pupil, this increases the sensitivity of the eye about 16 times. This 16 times improvement is pretty impressive, until you realise that the human eye can adjust its sensitivity by a factor of about 1 million!
Obviously there's other stuff going on.
One factor is that the eye adjusts its response to light by utilising a form of "gain control" in the nerves in the retina. The signal being sent to the brain is adjusted to allow for the overall brightness. When you come inside into a darker area, the signal is "turned up", so that your vision becomes more sensitive. This doesn't happen instantly, so things appear dark to begin with, but quickly start to appear brighter.
Another mechanism for adjusting the sensitivity of the eye is the regeneration of photopigments in the photoreceptors (the light-sensitive cells in the retina). Photopigments are molecules that change shape when they absorb light, setting off a chemical reaction that ultimately results in a nerve cell sending a signal down the optic nerve to the brain. Once a photopigment molecule absorbs a photon, it takes a while (and some fancy biochemistry) for it to change back to its original shape, "resetting" it so that it is ready to react to light again. When you come inside there are fewer photons hitting the retina, so more photopigment molecules can be reset. This is a slower process, so your vision becomes more sensitive over a period of a few minutes.
A fourth mechanism comes into play if you move into a really dark area. Your eyes have two types of photoreceptors, known as cones and rods. The cones work well in brighter conditions and allow for colour vision because there are 3 types of cones that respond differently to different wavelengths of light. Rods don't work well in bright light, but are very good at detecting small amounts of light. Because there is only one type of rod they can't distinguish colours, and because of the way they are spread out over the retina they aren't very good at seeing fine detail.
As the light gets dimmer, it reaches the point where the cones can't detect the light anymore. At this point the rods take over, allowing the eye to detect very dim light at the cost of losing some detail and colour vision. You can observe this if you go into a dark room (or turn off the light at night). Initially you can't see anything, but if you wait you can gradually start to make out shapes. After a few minutes you can see quite well, although not as well as with the lights on, and everything is in shades of grey, not colour.
BTW, there's another cool trick you can do with pupil reactions that doesn't depend on the amount of light. If you look at your eyes in a mirror, and then move closer to the mirror, your pupils will get smaller. The size of your pupils is linked to where your eyes are focussed - the closer you focus, the smaller your pupils.
The previous descriptions have all missed perhaps the most critical part of the light adaptation story in the vertebrate eye:
One of the last steps of the phototransduction cascade is the closing of cation channels in the photoreceptor cell membrane in response to light stimulation. For small amounts of light this has the main effect of hyperpolarizing the cell slightly, which decreases the likelihood of neurotransmitter release onto the target cells that pick up the signal for further processing. However, with a large quantity of light hitting the receptor, the closing of the cation channels may significantly reduce the intracellular concentration of calcium. Reduced intracellular calcium in turn upregulates the hydrolysis of GTP to cGMP by the guanylyl cyclase. Increased concentration of cGMP causes more cation channels to open and thus resets the dynamic range of the cell's response curve.
I can understand though how this step is easy to miss, the others being more intuitive.