Companies like Boeing get some of the revenue from selling consumer (civilian) hardware, and some from defense. Other companies are far more dedicated to producing military hardware (north of 90% of their sales in some cases.) Of the top 10 defense contractors in the world per Wikipedia, I looked only at the 7 U.S. ones that would exist in a similar tax and regulatory environment. The correlation is that the more arms sales, the less revenue.
So why be a defense contractor then? What often matters more is measures of unit profitability (indices like EPS, P:E - or if you're an employee,
profitability per employee.) And sure enough, excluding outlier L3, the more military business, the more profitable per employee.