When to use the former and when to use the latter?
Example:
Speaker A: I'm obsessed with philosophy, psychology, and sociology.
Speaker B: Is this why/how you know so much about these topics?
Or maybe they mean the same?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.
Sign up to join this communityThis is why is to explains a reason. This is how is to explains a process.
I had three rounds of tough intervews for this job, that is how I got hired. During one of the interview, I nailed a difficult problem, that is why i got hired.
for your example, it should be Speaker B: Is this why you know so much about these topics?
Since Speaker B is asking for an explanation, you should use why:
Is this why you know so much about these topics?
same as:
Why did you go to the beach today?
You would use how when describing actions:
How did you learn so much about these topics?
referring to what actions you took to learn so many things. Same as:
How do you hunt for seashells at the seashore?
However, I think many people would use how in example 2, in informal settings.
You usually use 'how' for asking the way or manner someone behaves, something happens or you do.
However, you can also use the "how" to mean by what means, for what reason, why, etc. How is it that he left early? How can you speak such nonsense? The how has been used in these sentences in the sense of why. (The Free Dictionary)
I think it's possible to use the 'how' to mean why in the context of the sentence presented by the OP.