I'm confused on DCI Banks? (More context below.)

I'm confused whether he is The Boss, like an actual Villain or he is undercover and trying to find out what Rex is up to. Can someone fill me in on the details.

(Before you ask yeah I watch HO still even though it's not in it's best right now but that's just an OCD thing, but anyways I'm confused about what is actually going on.)