Enter the theorycrafters
Ever since the dawn of Gygax, roleplaying games have had rules lawyers. Usually, a rules lawyer is that special individual who reads every single mechanic and figures out the most potent and powerful combination.
Theorycrafters are kind of like that, except they're armed with spreadsheets, combat logs, and a mastery of math of which we mere mortals can only dream. They started picking the game apart by comparing cast times, damage results, and all the likely algorithms that determine exactly how much damage is created by each ability. Then they strung all this information together and figured out the best way for your hunter to lay the biggest smack-down on the bad guy. This knowledge wasn't even vaguely limited to the notion of single attacks. The theorycrafters could build a timeframe of attacks. They could tell that if you cast all of your abilities in a certain order and then repeated that order, you would produce the optimal damage.
And the playerbase rejoiced.
It kind of sucked
Imagine what life was like then. You'd join a raid, and you'd know exactly which buttons to press in what order. A, B, C, D, A, B, C, D. You'd repeat until the bad guy died. Any deviation from the appropriate button order rendered you obsolete and labeled with the dread title of Noob.
Also, it was really boring. To simulate DPS life in real life, type the entire alphabet a dozen times or three. Then try and tell someone how your mastery of typing A through Z made you incredibly elite. You barely even have to type quickly; just hit a letter every second or two.
Blizzard looked down at all us players busily typing the alphabet and acknowledged that kind of sucked. Sure, most of the game was about gearing up and spending time in raids, not flawlessly executing A, B, C, and D over and over. But Blizzard knew this state of affairs lacked elegance. So it revised the system in a few different ways.
Behold the Solution: Priorities
While WoW scholars could spend hours at a buffet table arguing about when priority systems were actually invented, this new design of button pressing saw real prominence starting in Cataclysm.
Put shortly, this is a priority system: If A is available, use A. If it is not, then use B. If neither A or B is available, use C. Therefore, A > B > C.
But Blizzard knew this would just unfold into yet another rotation eventually if something didn't mix up the order by which those buttons became available. Designers provided a few variables and dynamics that would shake up your basic priorities.
Mixing up priorities
Procs are probably the most common priority shifter right now. A great example is Brain Freeze. Your average frost mage slams Frostbolt like it's going out of style. Hammer that Frostbolt button hard and fast. But when Brain Freeze procs, you switch to Frostfire Bolt. While you'd normally not be interested in using FFB, Brain Freeze has made it instant. In a time-to-cast vs. damage ratio, FFB just got super-valuable. This is an awesome way to mix up the priority system, because by assigning different procs to different spells, you really change the value of each ability quickly. Players have to react, and react fast, to achieve their best damage potential.
Resources are another interesting way to shuffle priorities. Not to pick on mages even more, but arcane mages have two different priority systems they use. The first is a mana-conservative priority routine. An arcane mage will conserve his mana by using certain spells according to procs but is otherwise careful not to deplete his resource. The second priority is a burn rotation. When trying to issue big damage super-fast, the priorities become mashing a single, powerful spell. Mana's just one resource, of course. Death knights have runic power, rogues use energy, and the list goes on and on.
What's the point?
Blizzard has other tricks to complicate your priority system. Some spells get more powerful according to buffs, debuffs, and statuses.
The ultimate goal has been to make life more interesting than just mashing a handful of buttons in a particular order. That old method is a pure damage rotation. The contemporary priority system, along with its complications, is much more interesting. It also gives a good player a chance to shine; the ability to react and adapt your priorities according to a situation is what shows off your real skill.
So there you go, Tim. That's the story of priorities versus rotations.
Visit the WoW Rookie Guide for links to everything you need to get started as a new player, from how to control your character and camera angles when you're just starting out, to learning how to tank, getting up to speed for heroics and even how to win Tol Barad.