In a nutshell
A deque — short for double-ended queue — is a line you can add to or remove from at either end, the front or the back, each in constant time. That makes it a stack and a queue rolled into one: use one end and it behaves Last-In-First-Out, use both in the usual way and it's First-In-First-Out. The flexibility suits things like a browser's back-and-forward history or a fixed-size window sliding over data.