くれていた

had done … for me

→ 呉れる
phrase Uncommon #15,727
had done … for me くれる marks an action as a favor or benefit for the speaker or someone in the speaker’s circle; いた places it in the past.
JA: 友達が駅まで送ってくれていた。
EN: My friend had driven me to the station.

お尻が、その理由を思い出させてくれていた。

My sore backside kept reminding me why.

彼女はジョンが以前に愛してくれていたと思った。

She thought John had loved her before.

彼女はジョンが愛してくれていたと思った。

She thought John had loved her.

スタッフが紅茶に新鮮な果物、それにスコーンを追加で用意してくれていた。

The staff had prepared fresh fruit and scones to go with the tea.

アントニオは私にもっと払ってくれていたが、それは秘密だった。

Antonio had been paying me more, but it was a secret.