Achilles is extremely upset that Hector (Hektor) has killed Patroclus and grieves over the body of his dead friend and cousin.
Gavin Hamilton has interpreted that event, from the Iliad, in this painting. The National Gallery of Scotland, where the painting is displayed, provides background about it:
Achilles refuses the comfort of his Greek comrades as he grieves over the dead body of his devoted attendant and friend, Patroclus, who was killed by the Trojans. The enormous size of Hamilton's painting conveys a sense of his ambition to depict episodes from Homer's 'Iliad' in an overpowering, epic mode.
His heroic compositions were designed to convey the dramatic and emotional range of the epic poem, based on Alexander Pope's translation. Hamilton painted six canvases, each commissioned by a different patron. This one, the finest in the series, was made for Sir James Grant between 1760 and 1763, and secured an international audience through Cunego's engravings.
Image and quoted information, from the National Galleries of Scotland.