The word comes from the Latin words *de* (from) and *fenestra* (window). It's most famously associated with the "Defenestration of Prague" in 1618, where two Catholic officials were thrown out of a window by Protestant rebels.
While the word is usually used figuratively to describe being thrown out of something, it can also be used literally, especially in humorous contexts.