Some sort of unofficial ranking off the top of my head... most frequent reason for underpromotion...
1) As a joke because they know it will be captured anyway
2) To avoid stalemate
3) To taunt the opponent (or an extra queen isn't available)
4) A knight is needed to fork
5) A knight or bishop is needed to win that specific endgame situation (knights can't lose tempi but can jump over pieces, bishops are only on one color but can mate when paired with another minor piece, etc).
99% of the time, one will promote to a queen. However, some may promote to a rook to still have a powerful piece, and have a better time avoiding stalemate. Some may promote to a knight in puzzles or if a REALLY specific move comes up where a knight and only a knight can checkmate or force checkmate on the next move. Some promote to a rook just to style on their opponent. This is an open forum where you can post situations/puzzles where underpromotion is a key aspect or needed, or just discussion on situations of that matter.