We use the third conditional (also known as the "past unreal conditional") to talk about situations in the past that didn’t happen and their hypothetical consequences.

The third conditional consists of two clauses. One is formed with If + subject + past perfect verb ("If I had studied"). The other is formed with subject + would have + past participle ("I would have passed the test"). So all together, the sentence looks like this: "If I had studied, I would have passed the test."

In the past, I didn't study. But by using this type of conditional, I can speculate about how things would have been different, if I had been a better student.