"movable or removable cover for a pot, etc.," mid-13c., from Old English hlid "covering, opening, gate," from Proto-Germanic *hlidan "a cover," literally "that which bends over" (source also of Old Norse hlið "gate, gap," Swedish lid "gate," Old French hlid, Middle Dutch lit, Dutch lid, Old High German hlit "lid, cover"), from PIE *klito-, from root *klei- "to lean."
Meaning "eyelid" is from early 13c. Slang sense of "hat, cap" is attested from 1896. As a measure of marijuana, one ounce, 1967, presumably the amount of dried weed that would fit in some commercial jar lid. Slang phrase put a lid on "clamp down on, silence, end" is from 1906; many figurative senses are from the image of a pot boiling over.