expression
Used when the speaker does not know or does not specify the reason for a situation; often implies a sense of inexplicability.
どうしたわけか、今日は電車が空いていた。
For some reason, the train was empty today.
どうしたわけか、彼は急に機嫌が悪くなった。
Somehow, he suddenly got into a bad mood.
expression
Used to ask for a reason, similar to なぜ, but with a slightly more indirect or wondering tone.
どうしたわけか、彼は何も言わずに出て行った。
Why did he leave without saying anything?
どうしたわけか、こんなに遅くまで連絡がないんだろう。
Why haven't they contacted me this late?