A stack is an ordered collection of elements where elements are only added and removed from the same end. Another term used to describe stacks is LIFO, which stands for last in, first out.
The characteristic that makes something a “stack” is that you can only add and remove elements from the same end. It doesn’t matter how you implement it, a “stack” is just an abstract interface.
Stacks and recursion are very similar. This is because recursion is actually done using a stack. Function calls are pushed on a stack. The call at the top of the stack at any given moment is the “active” call. On a return statement or the end of the function being reached, the current call is popped off the stack.
For algorithm problems, a stack is a good option whenever you can recognize the LIFO pattern. Usually, there will be some component of the problem that involves elements in the input interacting with each other. Interacting could mean matching elements together, querying some property such as “how far is the next largest element”, evaluating a mathematical equation given as a string, just comparing elements against each other, or any other abstract interaction.