Amid a slower year in M&A and capital markets, the legal industry has seen lower demand, and the market has forced some law firms to either shrink, merge or collapse.

But several law firms—even those with profits tied to the M&A market—have gained momentum in this environment, growing market share by adding rainmaking laterals from rivals or growing organically through promotions and retaining star talent.