A stack is a linear data structure that follows the LIFO (last in, first out) principle. Elements can be inserted and removed from only one end called the top. Main operations on a stack are push to insert, pop to remove, and peek to view the top element. A stack can be implemented using arrays or linked lists. An example demonstrates the steps and contents of a stack at each step for a sequence of push, pop, and peek operations on an array-based stack of size 3.