Jackson Lamb in the TV series is a darn sight better as a person and a character than he is in the books (at least the first four books which I’ve read). In the series, Lamb is uncouth and unpleasant but he also genuinely cares about his colleagues and tries to protect them.
The Lamb of the books is basically selfish and also an old white man’s fantasy - allowed to fart, pick his nose, and make disgusting racist and sexist jokes, all because he’s supernaturally more competent than anyone else. Cartwright’s job (and to a lesser degree everyone else’s) is to carry the idiot ball for him and make Lamb look good by being an athletic, younger, and more enthusiastic colleague who always fouls up.
(In a different way, Roddy Ho exists so that the author can make fun of geeks, Asian people, people who play computer games, and people who make him feel stupid by knowing more about technology than he does. He’s a terrible collection of cliches, but then so are most characters in the books.)
The above relationship definitely extends into the series, but I think Oldman does wonders making Lamb more sympathetic than he should be.