How should students approach quals? Most universities (at least in North America) have the concept of "Qualification Exams" taken one year after the student joins the graduate course. These usually encompass all that was done in the first year and as undergraduate and might also test some other (research abilities) of the student by asking him to present papers (s)he found interesting.

Some universities treat this as a formality and everyone who attempts usually gets through while some universities take quals very seriously and won't allow the student to continue if he fails the quals (maybe, they will allow for 2nd attempt). These universities might subscribe reading lists consisting of textbooks and papers which comprises of "must-have" knowledge of the field. The latter might constitute as a difficult phase for students who find themselves ill prepared in a certain portion of the exam. (For instance, a pure math undergrad moving to a PhD in Fluid Mechanics and asked to attempt an exam on Fluid Machines)

Assuming STEM graduate course in a university which takes quals seriously (with a structure of written test >   oral exam > interview/research proposal presentation), 

How should a student approach these exams?
Specifically,


How is it any different from the undergraduate exams that students give? 
Do you really "prepare" for these exams or should you bank on the courses you have taken and the homework you solved to get you through?
Repeatedly, I have been told by students (across departments and across institutes) that the faculty is only interested in the oral section of quals as a sanity check and to see whether you have the urge for learning something new; is this universally true?
Qualifying exams are never to be taken lightly. Even when they prove to be a surreal experience, they need to be given the attention appropriate to their seriousness. These are exams that you typically only have one or at most two chances to pass. As a result, you want to get through them on the first try, so that you don't have to worry about them again. 

How hard you have to work does depend a lot on the structure of the exam, and based on your previous preparation. If there are a lot of subjects to be tested with which you are not familiar, you may have to work harder than if you're getting A's in all of the classes that will be tested on the exam. (Even then, you'll still want to work through some practice problems to get a feel for the kinds of questions that are asked.)

As the original questioner mentions, in many cases the oral exam can be a "sanity check"—in more ways than one. If the decision has been largely made on the basis of the previous coursework and written quals, then the oral exam can act either to confirm the decisions of the panel, or as an effective psychological exam. One of my panels turned things into what amounted to a carnival side-show, with everybody acting completely out of character, and in a manner I found entirely unbefitting an oral qualifying exam. However, it made sense to see if there was any way to make me "snap" and lose my cool. (I was too busy trying to figure out why everybody was acting so oddly to really snap.)