High inflation weighs on both consumers and businesses. Many companies feel the sting of inflation as higher costs of goods and wages eat into profits.

One industry that has proven to be resilient in the face of inflation: insurance. Over the last year, the iShares U.S. Insurance ETF is slightly up (0.25%), while the S&P 500 index has fallen nearly 20%. Insurers held up well because they can quickly adapt to rising costs by raising premiums.

Two insurers caught my attention this year for different reasons: Kinsale Capital (KNSL -0.52%) and Markel (MKL -0.95%). Here's what you should know about these two stocks as well as which one is a better buy today.

Leveraging expertise to cover risks others won't take on

Kinsale Capital and Markel write insurance policies on hard-to-place risks, focusing on the excess & surplus (E&S) insurance market. Traditional insurers don't cover these types of policies because they are unusual and carry a higher risk than standard insurers are willing to take on. E&S insurers cover casualty insurance in high-risk areas vulnerable to natural disasters as well as professional liability insurance in high-risk industries.  

These insurers aren't regulated as strictly as standard insurers at the state level. As a result, they can be picky about what they cover and have more flexibility on the premiums they charge. This gives E&S insurers some wiggle room on pricing policies and can be profitable for companies that have built up expertise and understand all the risks they are taking.

Kinsale Capital is the better writer of insurance

One crucial metric to know when comparing insurers is the combined ratio. The combined ratio is calculated by adding losses and expenses and dividing that by the total premiums collected. Companies want this ratio to be under 100% because it means they are collecting more premiums than they are paying out; the lower the percentage, the better.

When writing policies, Kinsale Capital is better than Markel, hands down. Since becoming a publicly traded company in 2016, Kinsale Capital has averaged a combined ratio of 82%. In that same time, Markel averaged a combined ratio of 96.2%.

This suggests Kinsale is better at being selective about what it will cover and it focuses on the most profitable policies. Kinsale's combined ratio is unheard of in an industry where the average ratio is around 99%. If we're going with the best pure-play insurer, Kinsale is the clear winner.

A bar chart shows the combined ratio from 2016 through 2021 for Kinsale Capital and Markel Corporation.

Data source: Kinsale Capital and Markel 10-K filings.

Markel is often compared with Berkshire Hathaway

Many companies look to imitate Warren Buffett's success with Berkshire Hathaway. The Oracle of Omaha loves the insurance industry because it can invest other people's money -- and capitalize on that. Here's how. 

Insurers collect premiums upfront. They don't need to pay out claims until customers make them. In the time between, these companies have extra cash (called the "float") they can put to work. Markel invests its float in high-quality government, municipal, and corporate bonds. At the end of a policy period, the company keeps the remaining funds and invests in the stock market and other private companies.

Roughly 56% of Markel's investments are in fixed-maturity assets like Treasuries and mortgage-backed securities, with the remainder in equities and other short-term investments. In comparison, 91% of Kinsale Capital's investments are in fixed-maturity assets. 

Markel is more aggressive in trying to generate additional returns from its investments, which has earned it the "Baby Berkshire" nickname. The insurer's most significant stock investments are Berkshire Hathaway, Brookfield Asset Management, Alphabet, Home Depot, Amazon, and Visa. In 2021, Markel made nearly $2 billion off its investment gains. That's 15% of its total operating revenue.  

It also operates its Markel Ventures segment, where it invests in private businesses outside of insurance, like building products, crane rental services, and luxury consumer goods. From 2017 to 2021, revenue from this segment grew by 25% annually.

Buy this one today, and keep a watchful eye on the other

I like both companies, but in the current environment, Kinsale Capital is a better buy because it is a better pure-play insurer.

Market volatility hurt companies with significant investment portfolios this year. Markel's year-to-date investment losses are $1.9 billion; last year, it had investment gains of $1.2 billion. If markets continue to be volatile, Markel could see its investments take further hits.

However, as economic conditions improve, these investments could make Markel a better long-term buy. That'll likely come when inflationary pressures subside and central banks stop raising interest rates. If you're buying one of these two stocks right now, I'd recommend Kinsale -- but you should add Markel to your watchlist as one to buy as market conditions improve.