The Past Perfect is used to ‘go back’ for a moment when we are already talking about the past. It is used to make it clear that something had already happened at the time we are talking about
This is the past before the past.
When I arrived, Lucy had already gone home