I think we can see these two as foils when we look at the difference in their political attitudes. Boxer is a figure of blind zeal who shows nothing but complete enthusiasm (99% of the time). Benjamin, on the other hand, is politically disengaged. He is far from excited.
Maybe this is why Benjamin, the oldest animal on the farm, remains safe through the action of the revolution and Boxer ends up getting killed.
Boxer is the animal who believes whatever the leaders tell him. He works night and day because he believes that the Revolution will produce a better life for the animals. On the other hand, Benjamin is a cynic. He watches what is going on, but does not get taken in by it. He seems to know that nothing ever changes, that getting too excited about or involved in a revolution will lead to disapointment and frustration. Put simply, he is as cool as Boxer is hot. He expects nothing and gets nothing. But he is there at the end of the novel whereas Boxer is off to the glue factory.
Boxer is a wonderfully strong character who has an intense work ethic, is loyal and does not question the process. Boxer, a horse, has intense values and cares for all living things. He simply works to make everything better without complaint. Boxer works himself harder than every other animal on the farm and his mottoes throughout the novel are:
"I will work harder" and "Napoleon is always right."
Boxer gives everything he has to the success of the farm but when he becomes older and too sick to work Napoleon sells him to the slaughter house. His work on the windmill and all that he has done for the farm don't mean anything to the pigs.
Benjamin is a Donkey. He is "the oldest animal on the farm, and the worst tempered," is lazy and not a strong character at all. He is the exact opposite from Boxer. Benjamin doesn't trust the party or anything else. He refuses to read and he does anything he can to avoid work. His philosophy is that no matter how hard they work or what they do to advance, there will be no improvement in their way of life. At the time when the truck takes Boxer away it is Benjamin that tries to save him but is unsuccessful.
Boxer is the loyal unquestioning supporter of the government who doesn't complain but works to make things better. Benjamin is the person who sits around all the time complaining that the government isn't working, but he doesn't vote to change things.
My views are somewhat different from those presented in answer above.
To begin with it is not proper describe either Benjamin or Boxer as a foil for the other. The term foil is used in literature far a character which is used as a contrast to some main character to highlight the attributes of the main characters. In Animal Farm, Benjamin and Boxer are both independent characters important to the story in their own right and not just as a Foil. Besides, there are many similarities as well as differences between the two characters.
The main difference between Benjamin and Boxer is that Benjamin is very intelligent and cynical. In contrast Boxer has limited intelligence, but he is optimist and enthusiastic. The main similarity between them is that both are sincere and honest.
Approach of Benjamin to life has been very well summarized by Orwell in Chapter in following words:
Only old Benjamin professed to remember every detail of his long life and to know that things had never been, nor ever could be much better or much worse - hunger, hardship, and disappointment being, so he said, the unalterable law of life.
Thus Benjamin does not believe that the rebellion will make much change in their life, but he does his for the success of common task. Quite true normally he does not volunteer for extra work, but he also does not avoid work. Further, in time of his crisis he does not shrink from his duties of either fighting battles or doing hard work in times of urgent needs. It is just that he does not believe that there can be much improvement under any system, and therefore he not excited by the promise of the rebellion, and shows no enthusiasm. The only time he is excited when he finds that Boxer is being taken away by horse slaughterer, and at that time he is not wanting in initiative or action.
In contrast, Boxer is convinced about the the promise of bright future held by the rebellion and the subsequent management by pigs. He is also ready to put in his maximum efforts for converting his dream into reality. He does not understand how this will exactly happen, but he has put hi faith in Napoleon's wisdom and in his own hard work. His maxim is, "Napoleon is always right," and his motto is, "I will work harder".
Orwell has indeed used the adjective "worst tempered" for Benjamin, just as he has used the adjective "stupid" for Boxer. These words could be easily misunderstood when taken out of context. Benjamin is called bad tempered because he never laughs, remains quiet and aloof. Similarly Boxer is called stupid to describe his limited intellectual capabilities. I do not feel that Orwell has used these terms in a derogatory sense.
Although there are many differences between Benjamin and Boxer, they are also great friend. Benjamin feels deeply for the welfare of Boxer and advises against too hard as that would harm his health. Benjamin also shows his sincerity and caring nature in his attempts to look after Boxer when is sick. Clover also trusts and depends on Benjamin. Orwell does not spell out clearly the qualities of Benjamin that makes him so dependable and helpful, but one thing is clear he is helpful and dependable.