> Loser pays for frivolous lawsuits only (but not all failed lawsuits) is also a thing, and is common in US jurisdictions, but requires a separate court determination
Requiring a separate court determination is a coincidence of the American system, not a logical necessity.