See these short dialogues as illustrations.
"He's a good prime minister."
"How so?" (meaning "In what way is he good?")
"I want to give my mother a Formula 1 car."
"What for?" (meaning, "For what purpose? Does she need it?")
"I want to quit my job."
"Why?" (meaning, "What's the reason?")