There are many factors...sometimes there is genuinely some chance to complicate the position or try to lay a trap/trick. Other times the losing player is just annoyed and takes a while to accept they are losing.
I would suggest to play on until you are absolutely 100% lost. Firstly the opponent is no master level player and may blunder, secondly playing on in a losing position is good for your overall game. You are forced to be as resourceful as possible and can try whatever outrageous or unlikely moves you like as you are already lost.
Hello, I am 15 years old and I am in the chess club at my high school. Once when I was down 2 pawns I resigned and my opponent said "It's only 2 pawns". In a game that 2 people were playing someone was up a minor piece and said "I feel like being up a minor piece isn't decisive." Most of the games there are even less close than that. In almost every game there someone is down like 5 pieces or a queen. And no one resigns! Even the high rated players don't resign when they are down 5 pieces! This kind of stuff happens online, too. In most of my games online, I am up like 3 pieces. Why do people not resign when they are a piece or more down?