In Part I of The Stranger, Raymond and his entourage notice a group of Arabs following them. One of the Arabs includes the brother of Raymond's girlfriend, the one he beat. As such, the Arab men want to take revenge upon Raymond, but they want to get him alone to do it. Knowing this, Raymond invites the group as a kind of protection. He also wants to lay low out of town, because he knows the police will be asking him more questions about the abuse.
Meursault is an unwitting accomplice in Raymond's revenge against his girlfriend; he serves as a witness and writes the letter as bait. The excursion to the beach begins the turning point of the novel, and it contrasts with the earlier beach scenes with Meursault and Marie at the beginning of the novel.
In the earlier beach scene, Meursault had lived a carefree life, but with Raymond, Meursault mistakenly attaches himself to the culture of violence, revenge, and death. Raymond's cycle of revenge ironically leads to Meursault's death: Raymond beats his girlfriend, so she calls the police. When he is acquitted, her brother vows revenge. After the fight on the beach, during which Raymond is stabbed, the Arab achieves a kind of revenge. But Meursault, carrying Raymond's gun as protection, has his freedom threatened on the beach, and so the gun almost fires itself. It's an absurd ending for Meursault.
Groups are very important in the novel: the group of mourners, the group of Arabs, the jury, and the mob at the execution all stand as threats to Meursault's personal freedom.