Symbolism, Imagery, Allegory
Turn off all the lights in your room, and turn on a flashlight. Chances are, you can make out everything within the narrow circle of light created by the flashlight, but everything outside that narrow circle is difficult to see. Now turn the flashlight off. As your eyes adjust to the dimness of the room, you can probably make out a lot more.
The darkened rooms in which much of the novel takes place exploits this quirk in our biology. When K. does strike a light, the light doesn't seem to illumine very much. In the cathedral, for example, which is pitch black despite the fact it's almost noon outside, K. takes a light to get a closer look at a painting, but all he can really see is one piece of it, the guard. In the novel, lights emphasize the paradox that, in the light, you're actually blinded to the surrounding darkness. The light doesn't illumine the scary outside world out there; its purpose is really just to make you feel safe in your own little circle of light. Every moment of insight has its price in a greater blindness to the world at large. Which is basically just another way of saying that, if you really want to know about the things that go bump in the night, you have to turn off your night light.