The Stranger traces a year in the life of a young clerk working for a shipping company in 1940s Algiers. The setting – both time and place – are important to understand one vital piece of background information about The Stranger: Meursault may "officially" be on trial for killing a man, but he’s actually on trial for his character, and it is for this character that he is convicted.
How could this be? Notice that Raymond got off for beating his girlfriend since she cheated on him. Clearly, "character" is an important part of the law system of this time and place. Because the woman was a cheater, she deserved to get beaten – in the eyes of the law. Because Meursault has poor character (he is remorseless and cold), he deserves to be sent to the guillotine.
But this doesn’t begin to address why Meursault's murder of an Arab seems to not matter to these people. The answer here is racism. And now for a brief and spicy history lesson: The French started "colonizing" (invading) Algeria in 1830. By the time we get to the 1940’s, Algiers, the city in which The Stranger takes place, is French territory. That’s it. We told you it would be brief. The point is, in Meursault’s world, the French are considered superior to the Arabs. Killing an Arab was a minor offense, but not obeying French and Christian customs was apparently punishable by death. That’s why Meursault’s trial is so important – and so interesting to watch. When Meursault himself says he’s been convinced of his own guilt, he’s probably not talking about murder at all.