What he is referring to here is the so-called 'paradox of happiness', briefly touched upon earlier: experience shows that aiming directly at happiness is counterproductive, that precisely the 'pursuit of happiness' is what puts happiness out of reach. ('Desperate housewifes' are permanently miserable.) The reason for this is that happiness is a by-product of passionate engagement in some activity other than the pursuit of happiness, an engagement which demands that, not happiness, but rather the goal of this activity be the focus of one's attention. Happiness, Nietzsche is pointing out (correctly, it seems to me), can only be pursued indirectly since it is, in philosophical jargon, an 'epiphenomenon' of passionate commitment to something else: of doing well – or at least hopefully – something one considers important. That this is Nietzsche's point comes out very clearly in an already-quoted passage from Zarathustra [IV 1]. Nietzsche's alter ego says, 'What does happiness matter to me... I am striving after my work', to which his 'animals' reply 'but are you not basking in a sky-blue lake of happiness?' which Zarathustra, ruefully amused that the animals have divined his secret strategy, to admit he is. Happiness is a by-product of 'work'.

Julian Young Friedrich Nietzsche. A Philosophical Biography, 308