As the only really heroic character in John Steinbeck's Of Mice and Men, it is only fitting that Slim, with his "god-like eyes" that are extremely perceptive, should be the one to talk with George and rescue him from guilt for his act:
You hadda, George. I swear you hadda. Come on with me.
It is also fitting that Slim should be the one to console George since earlier in the novella Slim is described as having
ears that heard more than was said to him,and his slow speech had overtones, not of thought, but of understanding beyond thought.
Therefore, Slim understands why George gives Lennie a mercy killing. He knows that Lennie could never survive in prison; having a jail sentence would be worse than death for the innocent man who so loved nature. He would be all alone with no friends since the other inmates would most likely reject him because of his mental disability.
After George kills Lennie, Slim treats him in a very understanding way. He tells George that he knows that George did what he had to do. It is clear that he knows what really happened, but he is still kind to George.
The reason for this is that Slim is a very decent man. We have already seen this earlier in the book. We have seen it, for example, when Slim stands up to Curley and does not let him bully people.
Because Slim is fundamentally decent, he understands why George wanted to kill Lennie and spare him from what Curley would do to him.