In the Iliad, Achilles gives his friend Patroclus an elaborate funeral, involving the sacrifice of various animals, including 2 of Patroclus own dogs (presumably so they can be with him in the afterlife?) and also 12 young Trojan men whom he recently captured in battle, killed by cutting their throats.
Why does Achilles do this?
While the funeral is described at length, the sacrifice of the 12 young Trojan men is mentioned only briefly. We are not told their reactions as they have to wait to be killed one by one, by a method that will not kill them instantly but will lead to death quite quickly.
Killing them could perhaps be just a way to avenge the death of Patroclus, except Achilles has already done that in battle many times over.
Animals are often sacrificed to the gods in that World, often food animals such as cattle and sheep, probably with some sense of feeding the gods.
Human sacrifice, according to the myths and I think archaeology, was much less common but unfortunately did occur. While not mentioned by Homer, Agamemnon is usually said to have sacrificed his daughter Iphigenia for divine favour to obtain a favourable wind to take his fleet to Troy.
After the death of Achilles and the fall of Troy, when the Greeks share out the city's women and girls among themselves as slaves, they sacrifice the Trojan Princess Polyxena on Achilles' grave so that in a sense he can have one too.
But is there any sense in which Patroclus spirit or anyone else benefits from the sacrifice of the Trojans at his funeral?
P.S. There is a very good answer to this question by Yannis in the Comments below. That may well be all we need to know, but if anyone else can think of anything else they want to add, you are of course welcome to do so.