A stack is a data structure that follows the Last In, First Out (LIFO) principle, where the last element added to the stack is the first to be removed. It has two main operations: pushing (adding) an element onto the stack and popping (removing) an element from the top of the stack. Stacks are commonly used in programming for tasks such as function calls, expression evaluation, and backtracking algorithms.