Basically, this comes from alot of reading on Autopia and then practice and experience. Using different polish (or compounds) and pad combos on all kinds of scratches over time, will teach you what needs to be done to correct paint surfaces. Some mfg use grit number designations, some don't. The lower the grit number the more a defect you are looking at. A polish rated at 1000-1200 grit is designed to go after deeper swirls where a polish rated at 2000 will remove light-to-med swirls.
It took me a long time to learn this but after 4 years I think I'm pretty good now at looking at a scratch or swirl, determining what machine, polish, pad will remove the defect and then doing it. Hate to use a cliche but in this case "Practice Makes Perfect" still rules.