How do chemists decide on which detergent to use?
If it's polar, then it won't pick up grease because lipids (fats and oils) are generally non-polar. I don't know specifically how a detergent is chosen, but soaps are chemically the salts of a fatty acid. When choosing a detergent, you want a molecule with a polar head with a long, nonpolar tail. 

Recall that water is polar and polar substances dissolve polar substances, and nonpolar dissolve nonpolar. The detergent in a sense forms a "bridge" between the water and the nonpolar substances (dirt, grease, oil, etc.) which would not dissolve in pure water. The detergent molecules form little "cells" (my choice of this word is not a coincidence - this is also how your cell membranes work) with the polar heads facing out and the nonpolar tails mingling with nonpolar dirt molecules inside. This allows the dirt be washed away by water.

As to why certain detergents are chosen, it is probably a balance struck between safety, effectiveness, cost to mass-produce, possibly environmental considerations associated with production, etc.