Investing in the stock market is an excellent way to build wealth. As long-term investors, you want to look past today's hype and invest in high-quality companies with strong economic moats that can withstand the test of time. In the insurance industry, you can uncover hidden gems that meet this criteria.

Well-run insurance companies can grow during times of economic growth or inflation. This makes them resilient stocks that can adapt to a changing market environment.

A person looks at a computer monitor with financial charts.

Image source: Getty Images.

A product that is always in demand

Insurance products enjoy steady demand from both consumers and businesses. Rules and regulations often require companies or individuals to hold insurance policies on cars, homes, businesses, or other liabilities. Also, a person's natural aversion to loss is another driver of demand for insurance coverage.

Insurance companies operate differently than most businesses because they collect their fees upfront (premiums) before providing their service (resolving claims). These premium payments are a steady source of cash flow for these companies and provide them with a pile of cash called "float" that they can invest until claims come in.

These businesses can also see claims as they come in and adjust the premiums they charge accordingly. Over the past few years, insurers have seen higher claims costs due to rising wage and repair costs, more expensive catastrophic losses, and social inflation. As a result, premiums have surged, benefiting those insurers with the best underwriting abilities.

Here are three quality insurance companies you can add to your portfolio today.

1. Chubb is a huge player in the global insurance industry

Chubb (CB 3.55%) writes policies covering automotive, homeowners, and commercial insurance, including things like workers' compensation. The company has scale and a wide range of knowledge across different aspects of the industry and is one of the best at underwriting profitable policies.

Over the past year, the insurer has raked in $13.6 billion in free cash flow, which it can use to pay down debt, reward investors with dividends or share repurchases, or reinvest in the company.

This strong cash flow and its history of disciplined cash management are why Chubb has raised its dividend over the past three decades. The stock's returns have done better than the S&P 500 index.

2. Progressive is the best automotive insurer in the U.S.

When it comes to underwriting, perhaps no property and casualty insurer does it as well as Progressive (PGR 1.07%). The company's advantage is its vast amount of data and knowledge, which is driven by its long-standing goal of earning $4 in profit for every $100 in premiums written.

Progressive was a trailblazer in the auto insurance industry when it used driver data including speed, braking time, mileage driven, and acceleration habits to price policies beginning 20 years ago. The company has consistently generated an underwriting profit that beats its competitors and has delivered phenomenal results over the long haul.

3. Kinsale is a specialty insurer with an excellent performance over its short history

Kinsale Capital (KNSL 1.84%) differs slightly from Chubb and Progressive because it writes policies in the niche market of excess and surplus (E&S) insurance. The company covers policies that traditional insurers don't, such as small business casualty, professional liability, aviation, and recall products.

What makes E&S insurers appealing is that they aren't bound to the same strict regulations that standard insurers face. This gives them flexibility regarding what policies they'll cover and how much they can charge. The specialty insurer has grown at an impressive pace over the past several years while posting some of the best profitability metrics in the industry.

The stock fell following its first-quarter earnings, but investors shouldn't fret. The company continues to grow at a good rate while maintaining excellent profitability. The recent sell-off was likely due to Kinsale Capital's high valuation (similar to its Q3 earnings reaction last year), which presents an excellent buying opportunity for long-term investors.