We use this structure when we want to say that b occurred because of a.
Let's consider an example in English: "mum gave little brother a present, because he studied hard." In Mandarin, the "yinwei... suoyi" structure swaps the clauses around, into: "because little brother studied hard, mum gave him a present".
That's the basic idea, but let's break it down further so you remember the structure, step-by-step: "yinwei [subject + action], suoyi [subject + action + object + item]."
And that's it. You'll notice that this is quite easy to remember, as the word sequence of the sentence structure mimics English.