If Link dies in a dungeon, they respawn at the last entrance they used to enter said dungeon. The mirror warps Link to the same location, but if the player hasn’t found the mirror yet, it can sometimes be faster to let Link die than walk all the way back to the entrance.
One popular situation in which a death warp is commonly used is at the bottom of Escape in Zelda’s Cell room. When playing in Open Mode, the Escape chests can technically be checked from the beginning of the game with only a few bombs. Since it’s typically an early check, the mirror is not always in the player’s inventory, and rather than make the long trek back up from the bottom of the dungeon, many players will leave the green knight alive before dispatching the ball and chain guard with the Big Key. Once collecting the item in Zelda’s Cell, they allow the green knight to kill them, death warping them back to the entrance of Hyrule Castle.