The past perfect is mainly used to demonstrate a sequence of events in the past. In more complex narratives, it can also show past states and background information. The past perfect may be used to show the duration or degree of certain verbs of state, even when a continuous tense may seem appropriate. These verbs are generally the same states that use the simple tenses instead of the continuous tenses (such as be, know, understand, want). The past perfect shows that these states were complete, or took place, before another past event. I had known about the problem for two days when the printer broke.
- They had been to France four times before the millennium.
The past perfect is used in storytelling to provide background information. Main narratives in the past are usually in the simple tense, so the past perfect can provide details of events that happened before the main narrative.
It can establish past events, and add details which were not important enough to explain earlier, or it can help put events in order of discovery for the subject (for instance for tension).
- We talked for hours before I realised we had met before.
Grammatically, the Past Simple is more concerned with results (the travelling finished, and the petrol ran out) while the past perfect links the actions (the petrol ran out as a consequence of travelling / the travelling finished because the petrol run out). However, practically, most English speakers would understand both sentences to mean the same thing.