Technically, what you're seeing is not a freeze (though it's only a technical distinction). What's happening there is that some program is using up all of the CPU cycles, and so while the other programs are theoretically unaffected, they can't do any CPU time to do anything. It's like trying to talk to someone who won't shut up and so you can't get a word in edgewise. Oftentimes you can just wait and eventually one of them will slip through a command, but that could take a while, and you just hope it's what you needed to get some time in (like the Force Quit command, which you can trigger with Cmd-Opt-Esc, if you can't use the Menu bar). That's why the mouse still moves though, because the mouse cursor lives in the firmware and the graphics subsystem, so the CPU isn't involved in the movement of the cursor.
A kernel panic, btw, will result in one of two things: either a gray curtain will drop and a message will show up saying you need to restart your computer in 4 different languages, or white text on a black background will start filling up the screen and essentially give you the same message. The first is far more likely unless you're running an older system.
jW