Other forms: burning the midnight oil; burned the midnight oil; burns the midnight oil
If you've stayed up late to work or study, you've managed to burn the midnight oil—an idiom referring to the lamp oil used to see at night before there was electricity.
Midnight oil isn't a specific kind of oil. Instead, it refers to any lamp oil that people would burn so that they could see when it was dark outside. Historically, saying someone was "using the oil" meant they were working late into the night. This led to the old-fashioned critique, usually negative, that a piece of writing "smelt of the lamp" (or oil), implying the author had stayed up late toiling over it, perhaps making the work feel forced, unnatural, or over-studied.