In the movie, the Witch King breaks Gandalf's staff. How did this happen and why (since it's not in the book)?
While Gandalf faces the Witch King in Minas Tirith, there is no record of Gandalf's staff being broken. The flaming sword is seen in the scene in the book, from Return of the King, The Seige of Gondor:
After that scene, Rohan arrives, and the Witch King flies off to handle them.
The Witch King's ability to destroy other's weapons is found in the books, however. From The Fellowship of the Ring, Flight to the Ford:
From the same chapter, after the wraiths are driven off, Aragorn is examining the cloak left by the Witch King:
It's likely that Jackson interpreted Gandalf's raised staff as a "blade to pierce" the Witch King. It doesn't say in the books whether the WK could destroy an Istari's staff, but I think that scene is Jackson's interpretation of these scenes in the book.
AFAIK, there was no Jackson commentary on that specific scene, so one can only speculate.
As for "Why", the most cogent speculation I have seen on the forums is that the scene served to:
A second theory was that this was to highlight the power and contribution of the World of Men - Gandalf is almost beaten and can be killed by such a powerful adversary, yet saved by the fact that WK needs to go away and deal with Rohirrim - which, if you know the backstory of Istari, actually jibes with Tolkien's overall vision of the order of things (Olorin's mission is to inspire Middle Earthers to fight Sauron, not to fight him himself with his Mayar powers).
This has further symbolic significance in that this mirrors Gandalf the White's breaking of Saruman's staff.
As for "How", there just isn't any info. WK holds a flaming sword, stares at Gandalf, and the staff explodes.
In response to the 9 Feb at 0:45 answer.
It's stated in the book that Gandalf is a Maiar (Olórin), therefore he cannot be fully destroyed, only his physical form, just like Sauron's was. So, even though the Witch King had more power at that specific scene, he could not vanquish Gandalf, who would come back once more, and maybe even more powerful, as he did before.
I think the reason the staff breaks is because,
A. Sauron has infused a good amount of his power into the ring that the witch king bears, and since Sauron is much much much more powerful than Gandalf, he could have given the Witch King enough power to be more powerful than a normal Miar.
B. Staff is only a part of Gandalf's power, and Gandalf is not allowed to use his full power while on Middle Earth, only a small fraction of it. If he could use his full power, he could have destroyed Smaug, instead of getting a bunch of Dwarves to do it. The Balrog that Gandalf killed was probably much weaker than a Sauron aided/power-induced Witch King.
Therefore, for these reasons, mainly because the Witch King was heavily power fuelled by Sauron, it is very likely that the Witch King can hurt Gandalf. But who becomes the victor in a one-on-one battle remainsto be seen.