How do they avoid disincentivizing small parties from suing larger ones in this system? Let's say I have a strong case (say 90% chance of winning) to sue an insurance company for, say, $50k. But the cost of their legal team/experts/discovery to defend it is, ~$500k, then things look a bit more bleak.
Are there caps? Is one side prohibited from charging substantially more than the other?
I believe it's at the judges discretion. There was recently a case against a journalist who paid bribes on behalf of a news corporation in which the judge outright stated that if the corporation had been paying costs he would have ruled for a much larger costs settlement then he did when it emerged the journalist himself was going to have to pay. The remainder gets picked up by the taxpayer, so whatever happens the winning party isn't expected to pay the loser's costs.
Standard disclaimer: you should consult an actual solicitor!
I think it would somewhat depend on the judge's assessment of the situation, but I would think so long as you're acting in good faith they'd likely rule for you to pay whatever costs you can afford, and the rest would be covered by public finances.
It wouldn't surprise me to hear of judges deciding that the defence's legal team is grossly excessive and telling them they're not claiming for everything either, at least in the UK judges have quite a lot of leeway in what they can do in their own court room.
Well, if you want to sue them for $50k, and the cost of defense is $500k and your case is 90% chance to be lost, then the solution is quite simple - settle the case for 50k.
Limit the cost to reasonable costs. What is reasonable? Well, limiting the expense to the lower of the two parties' legal costs would strongly discourage the larger party from spending $500k on the case. And if they do it anyway, they pay for it themselves.
Are there caps? Is one side prohibited from charging substantially more than the other?