We use Past Perfect to tell somebody what had happened before something in the Past happened. The oldest event gets the Past Perfect.
Example:
I had eaten an apple and went to bed.

The eating of the apple is the older of the two events so we use the Past Perfect here.