What does "had had" mean? How does this differ from "had"?

Solution 1:

'Had' is the past form as well as the past participle of 'have'.

The first sentence is in the simple past tense which typically has this form:

Subject + past form of verb

I had (past tense of have) a bad day.

I reached (past tense form of 'reach') the office late.

The simple past is used normally to denote an action that is completed in the past.

The second sentence is in the past perfect tense which has this form:

Subject + had + past participle of verb

If two non-consecutive events happened in the past, this tense is used to show the first event.

By the time we arrived, the party had begun.

= The party began. Then we arrived.

By the time we arrived, they had eaten all the food!

= They ate all the food; then we arrived.

I had had a bad day already, and I arrived home to find that it had been robbed!

= I was having a bad day. During the day my home was robbed. Then I arrived home and found out about the robbery.

Refer to Kajaco's example as well. Here, the past perfect is used to show which incident/action happened first.

Solution 2:

Consider this sentence:

I had eaten my breakfast.

This is the past perfect form with the verb eat. This uses the past participle ( 3rd form) of the verb.
Now, just substitute the verb eat with have.

I had had my breakfast.