A stack is a data structure that stores elements in order, with the most recently added element on top. It follows a Last-In First-Out (LIFO) principle, which means that when an operation is performed to access or modify the topmost element, all other operations are performed on elements from bottom to top until the topmost element is reached again. Stacks are commonly used in programming languages for various purposes such as function calls and expression evaluation.