Cookie Monster can push Ernie's buttons in much the same way that Ernie pushes Bert's buttons. Thus the comic becomes the straight man, the trickster becomes the tricked, and Henson & Oz get to switch things up a little.
With that said, Ernie is kind of a jerk in this sketch. He has more cookies than anyone really needs, and he could have offered to share some with Cookie Monster. On the other hand, somehow Cookie Monster probably would have ended up getting all the cookies anyway, because that's usually what happens.
The pinky gag is really funny but somewhat problematic in that Cookie Monster has five fingers on each hand, while Ernie only has four.
And now, just because I love it, Alistair Cookie presents "The King and i":