The market share they gain back by preventing people from using their designs and closing their competitors far outweighs the legal costs. They are likely recouping court costs and legal fees as part of the suit along with lost revenue. Do you really think if it were a waste of money Gibson would spend decades and millions suing people? I might argue the suits are one of the most dependable cashflows feeding their bottom line.