And that's the joke. Sam's intellect is no great shakes, but the joke is that it doesn't matter. He has a whole battery of good character traits that make up for a, shall we say, fair to middling mind, such as loyalty, courage, not to mention insights into other people.