Nipple pain is caused by two major things: a poor latch and a bacteria called staph aureus. Other things can cause pain: vasospasm (or a constriction of the blood vessels of the nipple), Reynaud's phenomenon (where the nipple turns white, red, then blue) , pump trauma, certain skin conditions, tongue-tie, pregnancy, and other infections, like yeast. It's not meant to be an all-inclusive list, but you get the idea. Lots of things cause pain.
But we do we know , from lots of studies, that the vast majority of pain is due to a poor latch (and probably vasospasm after the latch is fixed ) and staph aureus. But we blame yeast for everything.