An Axios analysis found that the healthcare made record-level profits in the second quarter, increasing year-over-year earnings by 23%.

Even though drug companies create less than 20% of industry revenue, they still collected almost half of the profits.

One surprising finding was the windfalls hospitals are raking in from pricing and Wall Street investments; their profit margin is still above average.

Visit Business Insider's homepage for more stories.

The healthcare industry continued to rake in record-level profits in the second quarter, with its year-over-year earnings increasing by 23%, according to an Axios analysis of 160 companies.

The bottom line: Pharmaceutical firms and hospitals, in particular, are reaping some of the largest rewards even amid the sustained public furor over drug prices and surprise medical bills.

Where it stands: We updated our healthcare earnings tracker to include 48 not-for-profit hospital systems, many of which also own health insurance companies, and we will add more as more financial documents are released.

By the numbers: Big Pharma remains the cash king.

Drug companies collected almost half of all healthcare profits despite generating less than 20% of industry revenue.

12 of the 16 most profitable companies in Q2 were pharmaceutical firms.

This theme should sound familiar.

The intrigue: Hospitals don't retain as much money as drug companies, but their prices and Wall Street investments are still leading to sizable windfalls.

The combined net profit margin for this sample of hospital systems was 8.6%. That's lower than the extremely profitable first quarter hospitals had, but above average for the entire group.

first quarter hospitals had, but above average for the entire group. 17 of the 55 companies in the analysis that had net margins of at least 10% in Q2 were not-for-profit hospital systems.

The big picture: The profits don't just lead to hefty paydays. They allow the industry to amass a war chest to fend off piecemeal reforms and larger-scale overhauls like Medicare for All.