Beginner warning: Details follow which you may not wish to read at your current level.

Felix Felicis is a very complicated potion to brew, normally taking six months or more. Somehow, Professor Slughorn has some available for the first N.E.W.T.-level Potions class in Harry's sixth year, despite his having been hired less than two months before school started, and having arrived at Hogwarts on the Hogwarts Express less than a week before. The use of this potion is forbidden before Quidditch matches, academic tests, or any other kind of competition, because it constitutes an unfair advantage. Professor Slughorn offers a small amount of this potion as a prize to whoever brews the best potion in his first class; Harry wins this by following the marginal instructions in his second-hand Potions book.

Harry pretends to put some of this potion in Ron's pumpkin juice at breakfast before the first Quidditch match of Harry's sixth year; the confidence this gives Ron is enough to allow him to goalkeep well, where he had been suffering a bit of a crisis of confidence earlier.

Harry uses the potion on himself when he is attempting to retrieve a memory from Professor Slughorn at Professor Dumbledore's request. The potion makes him act in a way that would seem to an impartial observer to be irrational; the end result, however, is that he succeeds in getting the memory, which Slughorn has been withholding. A side effect is that he manages to break up the relationships between Ron and Lavender Brown, much to Ron's benefit, and between Dean Thomas and Ginny, much to his own benefit.

The remainder of the potion is shared between members of Dumbledore's Army, who are acting to defend Hogwarts in the battle at the end of book 6. The potion does seem to prevent their receiving any injury.

The mechanism at work with Felix Felicis is never explained, though it is perhaps reasonable to consider it an extension of the old concept of "making one's own luck." When Harry uses this potion he experiences a feeling of unlimited possibility. Under its influence Harry was nudged and guided to make certain inexplicable decisions that eventually lead to his success. Only a step or two at a time was made apparent, characterized more as whims rather than logical instructions; and Harry rightly referred to these as decisions made by the potion, rather than by himself.

There is an apparent belief on the part of Muggles that potions, like medicines, can only affect the person who takes them; while there is, quite possibly, some truth to this, Felix Felicis seems initially to act counter to this, taking Harry to places where he would never go of his own accord, and apparently impelling people to meet with Harry at Harry's pleasure. On close examination, however, we can see that Harry is, in fact, simply supernaturally good at picking up outside cues, and acting on them, while under the influence of Felix Felicis. Harry knows that it is twilight, and probably subconsciously knows of the phases of the moon, and so may guess, without realizing it, that Slughorn will be at the greenhouses collecting potion ingredients just then; he may also have somehow perceived Slughorn from his dormitory window. That one apparent coincidence, Harry's choosing to visit Hagrid by way of the greenhouses and somehow managing to meet Slughorn there, would seem to be the only inexplicable event in Harry's travels that evening. All else that befalls Harry can easily be seen as originating from within Harry himself. It is worth noting that Harry had earlier considered using Felix Felicis to try and get Ginny Weasley as his girlfriend and find a better match for Ron than Lavender Brown, so it is unsurprising that, consciously or otherwise, he engineered the breakup of Ginny and Dean, and of Lavender and Ron, while under the influence of Felix Felicis.