The most important thing to remember about how a candle burns is that it requires steady fuel, as well as a container. Brilliantly, the wax of a candle acts as both fuel and container, and while some fuel leaks from the edges of a free-standing candle, the rest is still the primary component in fuelling the flame.
So what role does the wick play? Consider it a wax conduit. It needs to be very absorbent - usually braided cotton - in order to absorb liquid wax. The braiding in the cotton creates a thin tube, and the tension in this tube leads to "capillary action:" the tendency of a small tube to give liquid nowhere else to spread but along it. This same process is what allows a sponge to soak up water. In a candle, the wick itself barely burns at all.
While the flame melts the wax so the wick can absorb it, the flame's heat also turns the melted wax to vapor. This gives the wick's capillary-action process room to bring more wax upward to the flame. It's the wax vapor, rather than the liquid wax, that burns - if melted wax was immediately flammable, holding a lit match to a pool of wax would create an explosion! Liquid wax requires much more heat than is around a candle flame to combust.
The candle's process keeps the heat high enough to keep the wax melting to bring it to the flame to turn it to vapor to burn it, to keep the heat high, and on and on. This constant cycle continues until one of the components (the wax, the flame or the wick) is taken out of the equation, either by running out of wax, blowing out the candle, or breaking the wick off.
You've probably noticed that when you blow out a candle, white smoke with a very characteristic "candle smell" continues to emit from the tip of the wick for a while. The white part of this smoke is the wax vapor. This vapor continues to be emitted until the tip of the wick loses the amount of heat required to vaporize the wax. Since the flame is gone, this doesn't take long - just long enough to stink up a room a little bit.
There's a reason a burning candle is often used as a meditation aid: stare at one long enough, and its function looks like some kind of magic. This isn't only due to the flame. Look closely (mind your eyebrows!) at the base of the wick in a candle that's been burning long enough to create a small pool of wax there, and you may notice some extra movement: the debris in the pool moves toward the wick, then away from it, then back to the wick again in an undulating motion.
The debris - little flecks of burned wick, mostly - are drawn in, under the surface, with the motion of heated wax, then lifted up and pushed away with the motion of cooled wax, like helpless little swimmers in an undertow or current. This ties in with why the wick itself barely burns - it's cooled by the process of the wax vaporizing, just as is a small amount of the liquid wax. Turning the liquid to vapor requires energy, and as the heat energy is used up by the transformation, it is taken away from the surrounding area (the wick and the liquid wax), resulting in slight cooling.
While it does not take place in a candle, it is possible to create fire with heat, wax, and no wick, but it requires a third ingredient liquid soda, for its carbonation. Yes, this does sound like an interesting research topic, but remember: trying this is a dangerous experiment that should only be performed with small quantities of ingredients, full sobriety, and the close supervision of mature, informed adults.