The fallacy of sunk costs
The title of this episode was 'Sunk Costs"
and at the end, Jimmy asks Kim what she sees in him and she says chalk it up to The fallacy of sunk costs.
This is like a gambling thing when you have already bet too much and you are losing, but you think if you just ride it out long enough you will make it back. So you keep betting and end up just losing more.
Also known as "throwing good money after bad".
Kim has too much emotionally invested and she can't walk away and will lose everything. And she knows it.