According to Wikipedia, primary affiliation refers to the state with which each president was primarily affiliated or most closely associated with, due to residence, professional career, and electoral history. It is not necessarily the state in which the president was born.
# is the number of US presidents representing a given state