Many countries use a "loser pays" form of civil litigation, in which the loser of the court case is forced to pay for the winner's legal fees.
There are two sides to this. On the one hand, there are many unnecessary and wasteful lawsuits percolating through the legal system; many estimates place the costs at between 250 billion and 1 trillion per year. Forcing losers to pay the winner's legal fees may prevent a number of these from being filed in the first place.
On the other hand, our judicial system has a lot of problems with politicization, conflicts of interest and incompetence. Forcing the loser to pay for the winner risks forcing innocent parties to pay for guilty (but more powerful) parties' legal fees.
You also have the problem that poor people may not be able to afford the exorbitant legal fees racked up by corporations and wealthier individuals. You also have an incentive problem where people who are sure they will win will purposely spend more than they should to punish the loser and reward their successful lawyer. You also have a positional externality problem where the relative value of a win vs a loss gets bigger, so you spend more on your lawyers to try and win, which widens the relative value, which causes more spending, etc.
One way to mitigate these problems would be a stipulation that the loser has to pay a percentage of the winner's fees, but not the whole amount. This could be subject to a cap based on the number of days of trial. In any case, a partial solution could be helpful.