This is not, generally, the law firms but legal investment companies (often founded and or run by ex-attorneys). There’s two, under reported, investment strategies in law. The first is funding class action lawsuits for a cut of the return - occasionally this can be paying out the actual class before a judgement and betting on getting a higher return when the case settles or is adjudicated. The second is this one, which is paying out to people who have already won a case and need cash fast before the normal payout date. It’s essentially payday lending for smaller settlements.
The billboard guys are just, usually, getting paid their normal cut of a lawsuit.