Bamidbar31:28

וַהֲרֵמֹתָ מֶכֶס לַיהוָה מֵאֵת אַנְשֵׁי הַמִּלְחָמָה הַיֹּצְאִים לַצָּבָא אֶחָד נֶפֶשׁ מֵחֲמֵשׁ הַמֵּאוֹת מִן־הָאָדָם וּמִן־הַבָּקָר וּמִן־הַחֲמֹרִים וּמִן־הַצֹּאן׃

And levy a tribute for the Eternal from the men of war who went out to battle: one soul of five hundred, of the persons, and of the cattle, and of the donkeys, and of the flocks.

Bamidbar 31:28

וַהֲרֵמֹתָ מֶכֶס לַיהוָה

Bamidbar / Numbers 31:28 · Pshat

Bamidbar 31:28

וַהֲרֵמֹתָ מֶכֶס לַיהוָה מֵאֵת אַנְשֵׁי הַמִּלְחָמָה הַיֹּצְאִים לַצָּבָא אֶחָד נֶפֶשׁ מֵחֲמֵשׁ הַמֵּאוֹת מִן־הָאָדָם וּמִן־הַבָּקָר וּמִן־הַחֲמֹרִים וּמִן־הַצֹּאן׃

And levy a tribute for the Eternal from the men of war who went out to battle: one soul of five hundred, of the persons, and of the cattle, and of the donkeys, and of the flocks.

Pshat פְּשָׁט

One of five hundred

From the spoil of war the Eternal commands a tribute to be set aside: from the soldiers one portion of five hundred, from the rest of the people one of fifty. The commentators explain where these numbers come from.

Chizkuni: the soldiers toiled in the war, so less was taken from them. Malbim: one fiftieth of the people went to war, so the congregation gives the Levites one of fifty, since victory came through the Levites' prayer too. One of five hundred is a tenth of that, like the tithe the Levites give the kohen. The tribute to Elazar (Eleazar) the kohen reminds the soldiers that they did not win by the sword.

How Chizkuni and Malbim explain it

Chizkuni From the men of war, one soul of five hundred

Since they toiled in the war, He made it lighter for them: one soul of five hundred, and give it to Elazar (Eleazar) the kohen.

Malbim And levy a tribute

He further commanded to set aside an offering: one of five hundred from the half of those who fought, and one of fifty from the half of the whole congregation. For as the congregation sent twelve thousand to war, which is one of fifty out of six hundred thousand, so the offering shall be one of fifty. And from the soldiers' half let them take a tenth of that, which is one of five hundred. And He commanded that the congregation's tribute, one of fifty, be given to the Levites, for in this the congregation was found worthy: the victory in war came through its merit and prayer, and in this it had great help from the Levites, who keep the charge of the Tabernacle of the Eternal, and whose prayer rose to heaven. Now the Levites are forbidden to take a share in spoil, as Rambam wrote (Laws of Shmita and Yovel, chapter 13), and this was not as a share but as an offering, which is why it was one of fifty. And the Levites must give from their share of the tithes one of ten, the offering of the tithe, and the Eternal commanded that Israel give this on their behalf: from the share of those who went out to the army one of five hundred is given, which is a tenth of the Levites' offering. And so that they would not mistake it for the actual offering of the tithe, which could also be received from the Levites by its law, He commanded that the portion of five hundred be set aside first and given to Elazar, and only after that the Levites' portion of fifty. And He set the offering to Elazar the kohen from the share of those who went out to the army, to make them hear: not by their sword do they inherit the land, but by the power and merit of the high priest, by the power of his son Pinchas (Phinehas) and the holy vessels in his hand, for a son brings merit to his father.

Takeaway

Twelve thousand went out to the war against Midyan, a thousand from each tribe (Bamidbar / Numbers 31:4–5).
The tithe is given to the Levites, and the Levites give the kohen a tenth of their tithe (Bamidbar / Numbers 18:26).
Pinchas went to war with the holy vessels and the trumpets for the alarm in his hand (Bamidbar / Numbers 31:6).