After murdering the Arab man on the beach, Meursault immediately uses a simile to describe the four shots he shoots after the first one:
Then I fired four more times at the motionless body where the bullets lodged without leaving a trace. And it was like knocking four quick times on the door of unhappiness.
While one shot could have been chalked up to an accident, and despite the fact that the Arab man had already stopped moving, Meursault fires his gun four more times. By shooting the Arab man multiple times after the initial shot, Meursault demonstrates how little he cares about this man's life, shooting him to ensure he dies even though he will later claim that he shot the man only because of the sun.
The simile "like knocking four quick times on the door of unhappiness" centers Meursault, the protagonist, over the man he has just murdered—Meursault feels like he is "knocking" on the "door of unhappiness," and the fact that he thinks about this suggests that he's not even considering the man he has just shot. This contributes to the reader's understanding of Meursault as apathetic, indifferent, and cruel, thinking only of himself even after he has murdered a man in cold blood. The fact that "the bullets lodged without leaving a trace" contributes to the ethereal nature of the murder scene, which is more like a dream than real life for Meursault. Ultimately, Meursault is figuratively knocking on the door between life and death in two ways: not only has he just killed someone, but he has just sentenced himself to death by so intentionally and unflinchingly transgressing against the law by committing murder.
When Meursault first sees the group of Arab men allegedly following Raymond, he uses a simile to describe how they stare:
We were just about to leave when all of a sudden Raymond motioned to me to look across the street. I saw a group of Arabs leaning against the front of the tobacconist’s shop. They were staring at us in silence, but in that way of theirs, as if we were nothing but stones or dead trees.
This simile is used to describe how Arab men look at French men like Meursault—as if, according to Meursault, French men are just “stones” or "dead trees." The phrase "[i]n that way of theirs" dismisses the Arab men and their actions as those of a different group (an other), thus centering the French-Arab colonial conflict in a story that is fundamentally about the murder of an Arab man by a French man. Ironically, it is Meursault who treats people like objects, whether he is claiming that nothing changed after his mother’s death or that he is killing another person almost involuntarily. While Meursault does not recognize the humanity of the Arab people, he uses figurative language to paint them as failing to recognize the humanity of the French.
As Meursault reflects on the differences between his life pre- and post-trial, he uses a simile to describe the ease with which his life changed forever:
What awaited me back then was always a night of easy, dreamless sleep. And yet something had changed, since it was back to my cell that I went to wait for the next day […] as if familiar paths traced in summer skies could lead as easily to prison as to the sleep of the innocent.
The idea that "familiar paths traced in summer skies could lead as easily to prison as to the sleep of the innocent" is very much the thesis of Meursault's outlook on life. Meursault believes in life's arbitrariness: what specifically makes up his life (who his girlfriend is or where, exactly‚ his job is) doesn't matter one way or the other for Meursault. While this perspective on life changes to some extent after being forced to confront his death while awaiting execution, even then the futility of life does not affect its seemingly arbitrary nature. The idea that leisurely walking down well-travelled roads could lead to prison just as easily as to a night of quiet sleep is true for Meursault, but for Meursault alone. Indeed, to end up imprisoned and sentenced to death required Meursault to make a series of choices and decisions that could only be made by a character with a powerfully apathetic worldview.
The simile highlights what is the same from person to person (the reality of everyday life) while obscuring what is different (the decisions made and actions undertaken that make some people murderers and others innocent). The specific word choice in "familiar paths traced through summer skies" suggests a wistfully lazy ease that is a harsh contrast to the seriousness of the trial. "Traced" in particular suggests a sort of determinism, as if people are just following the paths outlined for them. It is unsurprising that Meursault employs a simile that absolves people of agency, considering where he finds himself at this point in the novella.
After the chaplain insists on meeting with Meursault despite him wishing otherwise, Meursault compares the chaplain's life to that of a dead man through a simile:
He wasn’t even sure he was alive, because he was living like a dead man. Whereas it looked as if I was the one who’d come up emptyhanded. But I was sure about me, about everything, surer than he could ever be, sure of my life and sure of the death I had waiting for me. [...] at least I had as much of a hold on it as it had on me.
Meursault is an atheist, and despite confrontation with religious figures of authority, such as the examining magistrate who brandishes a crucifix at him during his investigation, he remains one throughout the novella. The chaplain, however, insists on visiting and questioning him regardless. The ensuing conflict between Meursault and the chaplain becomes a conflict between those with faith and those without it.
The simile “living like a dead man” flips the position of Meursault with that of the chaplain: Meursault is certain of his future—death and nothing more—whereas the chaplain can not be certain of what awaits him. In other writings, Camus makes a similar argument against those with religious faith. While the religious hope for a life after death or a reunion with God in heaven, the life of someone without hope or faith is a life of certainty—namely, a certainty of death. The simile conveys the importance of forgoing hope in order to embrace an absurd life: hoping for a better future or for life after death (or more generally for something that will never come) does not enrich one’s life for Camus. or Meursault. Rather, such a hope significantly undermines it.