Your own insurance company has a duty to defend you in some kinds of lawsuits. They are also required to settle in some cases. The most common example would be a car accident. Suppose you were at fault in the accident. Your insurer refuses to pay the other driver’s claims (refuses to settle), so the other driver has to file a lawsuit against you to pay their medical bills.
Your insurance company must pay for your legal defense here; if they don’t, they could be acting in bad faith. Either they agree to the other party’s settlement offer, or they defend you in court. Of course, this would not be the case if the reason for the accident falls outside your policy — for instance, they don’t have to defend you if you were under the influence.