Very very directly asks for a reason. (Which is why なぜ appears the rudest)
For when you really intend to be direct. "No bullshit, tell me the reason now".
どう(which way/manner) +
して(Verb conjunctive form of する)
どうする (Which way/manner of doing?)
どうして[X] (Which way/manner of doing did X come to be?) Which is functionally equivalent to "why" since you indirectly ask for a cause of [X]. Also functions as a "how" since you ask for the way/manner of doing it.
で (Instrumental particle)
何で (By what means) Which is functionally equivalent to "how"
"how" is a specific concept separate from "why" but share some similarities:
Question: Why? - Type of Response:
Use of Method(is a subset of
Question: How? - Type of Response:
Simple illustration of the slight overlap:
Why does it work? - It works because this method is being used.
How does it work? - It works through this method.
Following my above assessment of
どうして performing both functions of "why" and "how" and
何で for a functionally equivalent "how",
I would say that
何で may be replaced with
どうして may not always be replaced by
何で. (However I do not know enough about the difference in nuance between them.)
None of them does the exact same thing as
なぜ's nuance is its directness.