When you’re winning you think “I’M THE BEST. I’M ON A LUCKY STREAK. I WILL TAKE ADVANTAGE OF MY LUCKY STREAK.” and then you lose and now all you could think is how will you get back the money you lost. Then you’ll keep playing and you will keep losing because you keep playing even if you’re losing and this cycle continues for no end until you tell yourself that this should end now.
Greed is the main motivation for this. You’re greedy for wanting more and not being content to what you have won and greedy again because you can’t let go the fact that you’ve lost and there’s nothing much to do that could get you back your money.
And also I believe that by having a balanced understanding and belief in the sense of understanding that victory is nothing more than a lucky situation along with realizing that defeat will always be a part of gambling, it will make you more careful in every decision when you win or when you are in a winning situation, and this mindset will also be able to prevent you from various actions that lead to greed. In gambling, what should be prioritized is self-acceptance regarding the possibility of risk, because of course when a gambler is unable to accept the fact of losing then in the end it is like what you said where they will continue to gamble in order to catch up with the losses they have experienced, and that is a cycle that will make them lose even greater amounts of money.