The answers already given are complete and correct. Since your question may simply boil down to “what is a kernel” and “why did this happen”, let me try to explain the jargon.
The software on your computer exists in levels. For instance, there is a part called the windowing system. This is not an application you run, like Safari, but software that is called bySafari in order to draw the window, into which Safari draws webpages. The windowing system, in turn, doesn’t talk to the hardware directly, but talks to a lower-level software module that allows it to draw lines on the screen. Anything you do on your computer moves through these kinds of “levels of abstraction” until it gets to the software that talks directly to your hardware.
You kernel is the lowest level of software. It talks directly to your hardware and exposes all the things your computer can do to higher-level processes and modules.
The reason these levels are important is that the higher up something goes wrong, the better your computer deals with it. If you try to open a file that doesn’t exist in Safari, Safari will give you a friendly error, which you can use to correct the problem. If something goes wrong in the windowing system, things might start looking funny, or your mouse pointer may suddenly disappear.
A kernel panic happens when something goes wrong in the kernel. As you can guess, the resulting behavior of your computer is the most unfriendly possible. The best you can hope for is that your computer stops in its tracks and prints out a string of obscure looking information, as it did in your case.