Math. If you have 5 abilities, as a basic example, and the damage done for each is 1227, 1378, 1569, 1174 and 987... the highest damage is 1569. As you would continue through your abilities, trinkets etc. you start factoring in more numbers and it all adds up to a meta total which is the optimal spec. Another example with WW Monks where depending on the number of mobs during the fight you have to change 2 of your talents because you will get more damage done because of the math.
You don't need to min/max and I always say people should do what they like but one of the factors I see that a lot of people are horrible at is the teamwork perspective. If "I" am in a Normal raid and "I" want to play like this "I" can play like this but that isn't teamwork. Depending on the level of teamwork you want you could be selling your team short by being an "I" which is fine if you're into that sort of thing but from the perspective of everyone else in the raid it slowly builds up as a slight annoyance because all you care about is yourself. I try to play a class/spec that I want to play because that, ultimately, will be my level of fun in the game/raid etc. but once I am doing it I make sure I remove the "I" and do teamwork as my main priority. I enchant everything, min/max as best I can, use flasks, food, dps pots because I want the team to succeed because if they succeed than "I" succeed. In the same note I've met a lot of people who are just "I"'s during a raid and they don't care about dps pots, enchants, gems, changing specs because it's what "you" want to do but ultimately you are a drain on the team regardless of whether you care or not.
Back in the day with the "holy dps paladin" aka the Shockadin. No one liked those people and on some level they knew that because they did almost no healing and they did poor damage and when the loot would go out (because we needed 25 people for the raid) no one really wanted them to get anything because it would benefit someone else better. The same could be said now... you can make a Shockadin now by altering your stats and going full blown DPS but, as per the old days, everyone knows it and considering you don't need 25 people anymore for a raid (or 10) they want people who can succeed at their jobs. If you have a guild of 12 people... it's one thing to help out and be altruistic but deep down no one wants a Shockadin in their raid.