They don't block out light. Eyelids main purpose is to keep the eye clean, remove any dirt, keep the eye humid, and protect the eye from a direct hit by a foreign object.
Blocking some light is just a side effect of an object blocking the path of the light. Asking why you can't see that light has the same answer as asking why blocking a tree with your hand prevents you from seeing the tree.
The simple answer is: when you place an object infront of any light that is being reflected you will not fully see that light. Everything we see is light being reflected. This is the same as when you close your eyes.
In case you were wondering fully blind people don't see darkness. The best way someone who was fully blind from one eye could describe how he saw was: "imagine having a third eye in your forehead". Simply put a fully blind person sees nothing not even darkness.
Notice I only mentioned a fully blind person not a legally blind person (there are different types of legally blind people but they do see to a certain extent unlike a fully blind person).