The title pretty much covers it: how did they do it? The only rudimentary ways of lighting fires (mirrors, flint and steel, friction, etc) I can think of wouldn't work on a candle wick, at least not effectively, so how did they light candles?
Starting from a "there's no fire nearby" state would require breaking out a tinderbox and flint and steel. You would strike sparks from the flint and steel into material that would be highly susceptible to catching fire. This might be something super low tech such as ordinary tinder like wood shavings, dry pine needles, or what-have-you. It could be a little bit more sophisticated like chunks of charred wood left over from an old fire (or proper charcoal) or char cloth (the equivalent of charcoal except in cloth form). Once you have smoldering happening in your tinder then you could blow on it to encourage it to come up to a full flame, which you could then transfer elsewhere via a small wood splint or twig. Or if you have a candle you could use the heat to melt some of the wax into your smoldering tinder, which will light more easily, and then use that to catch the wick of the candle.
Keep in mind that the effective labor involved here is not just in the work described above but also in using up some of the materials (tinder, char cloth, etc.) which take labor to replace. So you'd generally avoid having to start a fire when possible. In a home you'd often keep a fire running all day and night, or perhaps simply "banked" overnight (hot coals covered and slowly cooling, ready to be used to start a new fire in the morning with just the addition of tinder, air, and some TLC). Then you'd simply light lamps and candles via splints you lit from the fire.
Toolkits similar to this (flint, steel, tinder) have been commonly in use since at least the Bronze Age if not longer. Otzi the ice man was found to have both flint and pyrite (for making sparks) as well as a tinder fungus (prepared into sheets).