Investing in the stock market is one great way to build long-term wealth. One essential component of investing is diversifying your portfolio across stocks with different risk profiles. Investments across industries are one great way to achieve diversification, and one sector you should consider investing in is insurance.

Insurance companies sell products that are always in demand, and their earnings tend to rise with economic growth and inflation. The two top insurance stocks you can buy this month are Berkshire Hathaway (BRK.A -0.76%) (BRK.B -0.69%) and Progressive (PGR -0.97%). Here's why these stocks could be a great addition to your portfolio.

1. Berkshire Hathaway's insurance businesses are cash-generating machines

Berkshire Hathaway may not strike you as an insurance stock. Most people know Berkshire for its chief executive officer, Warren Buffett, who is a legend in the investing world. Berkshire has a $372 billion investment portfolio, but the engine that drives that growth is its insurance operations.

The conglomerate owns several insurers outright, including GEICO, Berkshire Hathaway Reinsurance Group, National Indemnity, and its most recent $11.6 billion acquisition, Alleghany Corporation. Berkshire also owns stock in publicly traded insurance-related companies, including Aon, Globe Life, and Marsh & McLennan.

Insurance companies are the engine that propels Berkshire's huge cash balance, which it can use for long-term investments. That's because insurers are consistently taking in premium payments from customers. This cash, which insurers take in before paying out claims, is known as float and is a steady source of funds for Berkshire.

Since 1967, Berkshire's float has grown from $19 million to $164 billion -- a whopping 863,732% increase. Over time, Berkshire's insurance businesses consistently produce an underwriting profit -- meaning the conglomerate can freely use this cash to make investments. Berkshire has $128 billion in cash and liquid Treasury bills, which it can use for potential insurance claims and to invest across stocks and bonds.

Berkshire Hathaway is a huge company, and its insurance businesses ensure it will always have plenty of cash on hand to take advantage of great investment opportunities -- which is why it's my top insurance stock to buy in August.

2. Progressive's data advantage has helped it beat the industry for decades

Progressive primarily writes auto insurance policies and has historically been one of the best in the business. Progressive's industry-beating profitability goes back two decades, which can be attributed to its stellar underwriting ability.

Before anyone ever talked about artificial intelligence, machine learning, and big data, Progressive used driver data through its SnapShot product to price policies. This driver data is known as telematics, and Progressive began using it in 2004 but made it widely available to all drivers in 2010. 

More recently, Progressive stock has been volatile due to difficult conditions in the insurance industry. In the first half of this year, Progressive's combined ratio was 99.7%. The combined ratio measures how profitable an insurer's policies are as a ratio of its premiums collected to claims plus expenses. Progressive's long-term goal is to keep this ratio below 96%, which it has done since 2000. 

A person on the phone while looking at damage to their car.

Image source: Getty Images.

While Progressive's margins may not be as good as in the past, it's not a problem with its business. Automotive-focused insurance companies have seen the most significant losses, with this segment experiencing its worst loss ratios in two decades in the first quarter. The result of these harsh industry conditions is a hard insurance market. In hard markets, insurers see claims costs climb higher and adjust premiums to adapt to rising prices. The ability of insurers to adjust to rising costs is one reason they can be solid hedges against inflation.

Compared to peers, Progressive held up well in the second quarter. It posted a combined ratio of 100.4%, well below Allstate, another auto insurer, whose combined ratio was 117.6%. While insurers face difficult conditions today, they must adjust by raising premiums further. Progressive has a long history of outperformance, and its recent stock price dip is an excellent opportunity for long-term investors to add a position in the insurer.