(This question is a big spoiler of seasons 1-6)
In one of the early seasons, we find out that the Lannister gold mines have been empty for ages and that they took large loans from the Iron Bank of Bravos. Recently, they also broke their alliance with the Tyrells who supplied the kingdom with food. They also lost their last son who could have a legitimate claim on the Iron Throne. Cersei killed the very popular High Sparrow and Queen Margaery, and razed the Sept which must have ruined their already weak popular support. I also imagine their armies are not in perfect condition after long and deadly conflicts.
In summary, the Lannisters don't have any money, supplies, popularity, allies, strong army or even a legitimate claim on the Iron Throne. However they do have many enemies, high debt and overstretched borders. My question is, what even keeps them going and do they have any trump cards left? Is their end inevitable now?