There is a book about the whole thing, and I read excerpts way back when. Leno's agent, Helen something-or-other, did quite a bit of backstage manuvering to try and get Carson out and Leno in. There were also stories of Leno hiding in closets when execs were meeting, trying to find out if he or Letterman would get the gig. That's how desperate he was to get the job. Carson wanted Letterman to succeed him. I guess he got back at Leno by feeding jokes to Letterman. :)
It was pretty telling when Carson didn't mention Leno at all during his final show, and refused to ever appear on the show again. I heard that all the tonight show staff was fired, even the set workers, due to a fear that they were loyal to Carson.