The application is not accepting new keyboard/mouse/system events from the operating system. Applications run in an event loop, where they accept an event from the OS—a keyboard push, a mouse click, a system notification, or what have you, and then process it. Sometimes this processing takes longer than it should, and the application doesn’t get back around accepting events for a few tenths of a second.
If you pay attention, the beach ball only appears when you have the mouse over one application. (Unless something in the system’s event handling gets screwed up, and the same problem causes multiple applications to get wedged and to not accept events.)