I may be misremembering, but I vaguely recall that somewhere in the marxist (or communist) ideology there was a claim like war (and I mean actual war, not class war) benefits the rich (maybe even in all/both countries involved) at the expense of the poor (again perhaps in all/both countries)?
Sorry if this is a fairly vague statement to go by... Also it's possible the claim may have preceded Marx. Come to think of it, Marx would have probably framed it as the bourgeoisie benefitting and the proletariat losing.
There have been many pronouncements of this type; they became particularly popular during and after WWI; although during the war the position of the socialist parties was that not so much about the profit but the fact that the proletarians of Europe were fighting each other along national lines instead of fighting their class enemies.
From your wording, maybe you are refering to War Is A Racket, by Smedley D. Butler, a retired -at the time of publication- Major General of the USMC.
War is a racket. It always has been. It is possibly the oldest, easily the most profitable, surely the most vicious. It is the only one international in scope. It is the only one in which the profits are reckoned in dollars and the losses in lives. A racket is best described, I believe, as something that is not what it seems to the majority of the people. Only a small 'inside' group knows what it is about. It is conducted for the benefit of the very few, at the expense of the very many. Out of war a few people make huge fortunes.
He also made these comments in a socialist magazine to the same effect:
I spent 33 years and four months in active military service and during that period I spent most of my time as a high class muscle man for Big Business, for Wall Street and the bankers. In short, I was a racketeer, a gangster for capitalism. I helped make Mexico and especially Tampico safe for American oil interests in 1914. I helped make Haiti and Cuba a decent place for the National City Bank boys to collect revenues in. I helped in the raping of half a dozen Central American republics for the benefit of Wall Street. I helped purify Nicaragua for the International Banking House of Brown Brothers in 1902–1912. I brought light to the Dominican Republic for the American sugar interests in 1916. I helped make Honduras right for the American fruit companies in 1903. In China in 1927 I helped see to it that Standard Oil went on its way unmolested. Looking back on it, I might have given Al Capone a few hints. The best he could do was to operate his racket in three districts. I operated on three continents.
The closest thing I found is a song by rebelling/deserting German soldier in the closing days of WWI.
It’s all a Swindle:
The War is for the Wealthy,
The Middle Class must give way.
The People provide the corpses.
It's not too clear how much this was influenced by Lenin's somewhat similar proclamations, e.g. in "The Tasks of Revolutionary Social Democracy in the European War" (1914):
the necessity of using weapons not against one’s own brothers, the hired slaves of other countries, but against the reactionary and bourgeois governments and parties of all nations
even though that doesn't talk about profit. Separately, Lenin said in his May Day speech (1915)
"War is a “terrible” thing? Yes. But it is a terribly profitable thing."
I guess Sartre should get a mention here for saying it more concisely (although not as precisely) in The Devil and the Good Lord (1951):
When the rich wage war, it's the poor who die.
And as "the rich man's war and poor man's fight" it goes back to the US civil war.
To answer @gerrit's request for the German original of the song; it's given in R. Bessel, Germany After the First World War (Oxford, 1993, p. 1)"
Es ist alles Schwindel:
Der Krieg ist für die Reichen,
Der Mittelstand muß weichen,
Das Volk, das stellt die Leichen.
A bit more searching finds a book in German: H.C.Grünefeld "Die Revolution marschiert: 1806 - 1930" with a several songs on the same theme (around p. 341 in vol 2)
What you describe, is referred to by the term "imperialism", i.e. a policy that involves a nation extending its power by the acquisition of lands by purchase, diplomacy or military force.
While you can find some references on imperialism in Marx, they are mainly focus on what he describes as primitive accumulation, where the origins of capital are explained, as well as colonization.
The actual analysis of imperialism is mainly done by
1) Lenin, in "Imperialism, the Highest Stage of Capitalism (1917)", where he describes the function of financial capital in generating profits from imperialist colonialism as the final stage of capitalist development to ensure greater profits and
2) Roza Luxemburg, in "The Accumulation of Capital: A Contribution to an Economic Explanation of Imperialism", where she argued that capitalism needs to constantly expand into noncapitalist areas in order to access new supply sources, markets for surplus value, and reservoirs of labor.
As far as historical records are concerned, though they cannot be described as analysis of Imperialism (since the latest is a more recent term), but can be seen as an materialistic-dialectic view on history, traces can be observed even in ancient Greek writing, ex.
1) Euripedes, Helen, where the it is argued that the Trojan War was not actually made for the beautiful eyes of Helen, but for greek expansion over the Aegean Sea.
2) Aristophanes, who clearly associates war, pillages and destruction with the end of the self-sustained village society
3) Thucydides, the father of scientific history, when analyzing the economic background of athenean expansion, during Peloponnesian War.
4) In Aristotle's Politics, where he explains how wars are employed to provide the society with new labor power (slaves).
There are many Marxists who have mentioned war. At heart, Marx is an economic determinist: literally everything in society happens because of economics. Here are a few you may be thinking of:
Although he doesn't specifically call out war, in the Communist Manifesto Marx describes the modern world as having a problem of too much stuff. Industrialized society produces far more than is needed, which is terrible for profits. The bourgeoisie use "commercial crises" to destroy the extra stuff, so that they can justify producing it (and selling it) all over again. It is no stretch to see how this applies directly to warfare: arms manufacturers need us to use ammunition, vehicles, and other goods in order for them to keep making profit.
Of course, the same also applies to many other forms of social crises.
Source: Section I of the Communist Manifesto (pg.17 here).
Rosa Luxemburg is perhaps more famous for her views on war. In The Accumulation of Capital she argues that the central drive of all capitalist societies is to open up new markets. The entire last chapter is dedicated to capitalism and war.
A few of her arguments:
Governments purchase large quantities of good to support warfare. This is of course valuable to the industries that produce those goods.
Through taxes (both direct and indirect) workers' wages are taken from them to support the military. More workers are pressed into military service and to work in industries that support the military. Workers don't need that military (because it's purpose is to open markets and seize means of production), so workers are forced to support their own and others' exploitation.