Recently, a young character said to his screen mother something along the lines of:

*If I knew it was him, I would have told you.

He was feeling guilty because a friend had told him she was seeing someone older but she hadn’t revealed who or how much older, and this older person had got her into trouble with the police. He should have said:

If I had known it was him, I would have told you.

Unreal — that’s the difference. The youngster’s ‘knowing’ was an unreal past event, a thing in the past that didn’t actually happen.

When we talk about a real situation in a conditional clause (if-clause), we use tenses in the same way as we do in clauses with other conjunctions: present to express present, past to express past, and, like in clauses with other conjunctions, the present tense is also used to express the future.

If temperatures fall below zero, water turns into ice. (real present)

If I find out who he is, I will tell you. (real future)

If you found out who he was, why didn’t you tell me? (real past)

Unicorn (1658). This woodcut is an illustration from the book The history of four-footed beasts and serpents … by Edward Topsell. Book held in the University of Houston Libraries in Houston, USA. Public domain.

When we talk about an unreal situation, unlikely to happen, untrue, or imaginary, we use tenses in a different way, in order to distance what we say from reality. In the conditional clause, we use past tenses even when we are talking about the present or the future, and in the main clause we use the modal verb would.