To understand what Wordsworth is saying in this very famous utterance, we need to look at the full quote. He writes the following in his "Preface" to Lyrical Ballads:
I have said that poetry is the spontaneous overflow of powerful feelings: it takes its origin from emotion recollected in tranquillity: the emotion is contemplated till, by a species of reaction, the tranquillity gradually disappears, and an emotion, kindred to that which was before the subject of contemplation, is gradually produced, and does itself actually exist in the mind.
In saying that poetry is based on feelings, Wordsworth is making a powerful statement about the kind of poetry he and his friends in the Romantic movement are writing: it is lyrical poetry, poetry emanating from emotions. This is a direct challenge to the cool, reasoned poetry of the Neoclassic eighteenth century, which was often based on recounting events from the classical world of ancient Greece and Rome in perfectly rhyming couplets. Wordsworth is rejecting that kind of distanced, detached form of poetry in favor of poetry that is an impassioned response to real life.
Such poetry, Wordsworth says earlier in the preface, has to have a meaning. The initial powerful emotions that motivate us to express ourselves in verse have to be contemplated "long and deeply" and must be "directed" by our thoughts. In this way, the poet learns through habit to locate or "distill" what is important from the overflow of feelings. As the poet learns to direct his thoughts, he is able to communicate to his readers what, from his jumble of heightened emotions, will help them to be "enlightened ... strengthened and purified."
Wordsworth believed poetry should have a moral purpose, and his poems do, often pointing out to people how they can see evidence of the divine in nature or how the simple experiences one has in nature can bring great joy. He says, however, in the quote above, that to do that is a three-step process: first, the poet must encounter something that causes him to experience very strong emotions; second, he must discipline his mind to think about what message from these emotions can help enlighten other people; and third, once he knows his message, he has to recreate his initial emotions so that he can express them in a sincere and heartfelt way in a poem.
The idea of poetry being a "spontaneous" overflow of powerful feelings is in conflict with the idea of emotion "recollected in tranquillity": Wordsworth was poet, not an essay writer, and he doesn't say exactly what he means. However, he offers us a detailed enough account of what he is talking about that we can unravel his intent: what he means is that poetry originates in strong emotions that pour out of a person spontaneously but is composed only after contemplation that allows careful analysis of these feelings.
An example of a poem that illustrates this pattern is "I Wandered Lonely as a Cloud." The speaker, who has felt sad and lonely, experiences a powerful feeling of joy when he suddenly comes across thousands of daffodils waving in the wind in front of a lake. However, rather than rushing home and writing down a blather of emotions about this experience, he lets the memory sit with him and process. He doesn't write the poem until much later, when he has had occasion, in cold weather, to lie on his couch and recall the experience in tranquility. The poem, therefore, communicates the message that an experience of nature is not only emotionally moving at the time it occurs but can offer us countless repetitions of that joyful feeling as we remember it. If Wordsworth (or his speaker) had not taken the time to think about this event created by a spontaneous overflow of feeling, he could not have written a poem that celebrates the importance of memory—and memory becomes a theme in many of his poems.