Even though there are 64 squares and only 32 pieces, those squares can run out and your pieces can be left out without legal moves and getting trapped. It is a frustrating situation when you can't save a piece from being taken because you didn't foresee it would get trapped a few moves before.
Sometimes, even with a pawn move, you can take away your opponent's safe squares. Even queens are vulnerable to be trapped because any trade for a lesser piece is dangerous.
The Queen is such a powerful piece and it controls so many squares, it is hard to believe it can be trapped, but with the correct tactics and a positive position, every piece is trappable.
In this position everything seems fine, but a very common trapping scheme is possible, try to spot it.
The King castles king side, and then a trap is unavoidable.
White advances the pawn, forcing the knight to retreat to the only available square for it, and then...
A simple pawn advance traps the bishop, a bishop that was out of danger two moves ago is now under threat and will be taken on the next turn.