This may go some way to explaining it.
http://en.wikipedia.org/wiki/James_while_John_ had_had_had_had_had_had_had_had_had_had_had_a_ better_effect_on_the_teacher
I can explain this one by putting in a few extra words and changing others, thus:
(In an essay) John had had (the word) HAD but James had had (the words) HAD HAD. (Full stop)
(James's words) HAD HAD had had a better effect ,etc.
If you are still confused try changing some of the hads to used:
In an essay, John had used the word HAD but James had used the two words HAD HAD. The words that James used had had a better effect...
It's supposed to be clever and to illustrate how it is possible to repeat one word many times in a sentence and maintain grammatical sense. On the other hand it can also demonstrate the need for punctuation to convey clear meaning.
I think it was Stephen Fry who wrote a sentence containing 7 consecutive prepositions. It concerns a small boy whose mother had brought upstairs a book on Australia from which to read him a bedtime story. "What have you brought a book to read out of on down under up for?"