What follows is a lengthy quote from a Court of Appeals Opinion that does a nice job of explaining the issue:
Washington cases mention four recognized equitable grounds for awards of attorney fees: bad faith conduct of the losing party, preservation of a common fund, protection of constitutional principles, and private attorney general actions. Dempere v. Nelson, 76 Wn. App. 403, 407, 886 P.2d 219 (1994), abrogated on other grounds by Burnet v. Spokane Ambulance, 131 Wn.2d 484, 933 P.2d 1036 (1997). There are three types of bad faith conduct that warrant attorneys fees: (1) prelitigation misconduct, (2) procedural bad faith, and (3) substantive bad faith. Rogerson Hiller Corp. v. Port of Port Angeles, 96 Wn. App. 918, 927, 982 P.2d 131 (1999).
Prelitigation misconduct refers to obdurate or obstinate conduct that necessitates legal action to enforce a clearly valid claim or right. Rogerson, 96 Wn. App. at 927. Procedural bad faith is unrelated to the merits of the case and refers to vexatious conduct during the course of litigation, such as delaying or disrupting proceedings. Rogerson, 96 Wn. App. at 928. Substantive bad faith occurs when a party intentionally brings a frivolous claim, counterclaim, or defense with improper motive. Rogerson, 96 Wn. App. at 929. In other words, simply bringing a frivolous claim is not enough; there must be evidence of an intentionally frivolous claim brought for the purpose of harassment. Rogerson, 96 Wn. App. at 929.
Quoted Source: Dave Johnson Ins., Inc. v. Wright, 167 Wn. App. 758 (2012).