What's the difference between rainbow and regular spinning wheel? I usually see the well known rainbow colored spinning wheel when the Mac is working on something, but sometimes there is a blue one. What is the difference between them? Do they come from the OS and have a special meaning or is it application dependent?
The rainbow spinning pinwheel is usually controlled by the OS.
  The blue pinwheel is shown by an app to indicate loading.



  The spinning wait cursor (shown below) is also standard, but it is displayed automatically by the window server when an app can't handle all of the events it receives. In general, if an app does not respond for about 2 to 4 seconds, the spinning wait cursor appears. If the app continues to be unresponsive, users often react by force-quitting it.


Source: OS X Human Interface Guidelines: Use the Right Pointer for the Job

The blue pinwheel is sometimes called the JavaScript pinwheel as JavaScript in websites are one of the primary ways a user will see this cursor, for cross-platform reasons, as in OS X a 'waiting' cursor is generally not recommended.