I think that confidence and motivation are somehow linked to each other. If you are not confident you won't feel like playing a gambling because in your head you will say that you will still lose so it would be better if you can just save that money or use that money in more valuable things. The same goes to motivation.
Those who continue despite of their previous losses are either playing for fun or they are simply motivated/confident that they can recover all their past losses once they win a really huge amount in gambling. It can be though jackpots or they will hunt a massive multiplier or they can build their balance from the bottom to the top slowly but surely.
Actually if you continue to play you risk losing other money in gambling, so if the goal is to have fun then you don't force yourself to continue because it is very difficult to control yourself after experiencing high losses, so it is highly recommended to recover some losses to be reused for the next gambling , but if it is not possible then quitting gambling will be an option and you can come back tomorrow to gamble.