The general rule, in America, is that each party to a lawsuit pays his or her own legal fees, even if he or she wins. The rule is the opposite in England where it is assumed that the losing party to a lawsuit will pay the legal fees of both sides. This rule is of tremendous practical importance, because, of course, litigation can be very expensive.
There are two primary exceptions to the American rule. First, if the dispute arises out of a contract, and if the contract contains an attorney fee clause, then the prevailing party in the case will have his or her attorney fees paid by the other side. Second, if a statute provides for payment of attorney fees to the winner, they will be paid.
The first exception is often important in real estate cases, because many real estate contracts contain attorney fee clauses. In California, Civil Code Section 1717 provides that, if a contract contains any type of attorney fee clause, it will be interpreted to benefit both parties to the contract. For example, in many loan contracts, the attorney fee clause may be written in a one-sided way to say that, if there is litigation, the lender will be paid its legal fees. Civil Code 1717 says, it does not matter how such clauses are written, the courts will read them to mean that the prevailing party in the lawsuit will be paid his or her legal fees.