The vast majority of what you see on the TV news is, in fact, scripted. It has to be, because the anchor and/or reporter has to make sure that facts are reported correctly, and that the story is coherently told. In fact, much of the training I got in journalism school is in writing, including how to write a story under pressure. If necessary, I could probably write a story in 10 minutes or so. Believe me, being on the air is harder than it looks, and going on without a script or some idea of what you’re going to say is suicide.
The interviewer also does his homework to know what to ask, and the best ones (like Anderson Cooper or Terry Gross) know when to deviate from the prepared questions and go in a different direction if the guest brings up an interesting point that should be examined further. The worst interviewers don’t deviate from the prepared questions at all, and sound stupid as a result.
That being said, there is a certain amount of negotiation involved when a guest is asked to be on an interview show. There may be ground rules established so there won’t be any gotcha questions, and, frankly, any politician who voluntarily goes on one of these shows has likely been prepped by his people so they know how to answer any expected questions without sounding stupid. The issue with Sarah Palin, however, was that she wasn’t prepared well for the Couric interviews, and I think there was a certain amount of assumption on the McCain campaign’s part that Couric would be lobbing softball questions, so there was no need to prepare. Naturally, Ms. Palin claimed bias on Ms. Couric’s part and blamed her for her poor performance.