To answer your question, I suspect they do it by importing other people's trees. Whether the other people's tree are correct or even in the slightest believable is a different matter!
Claiming descent from Jesus and Mary Magdalene is obviously (pace Dan Brown) plain daft, regardless of whether or not you believe they had issue (anyone see that programme on Channel 5 about Mary Magdalene a few weeks ago, by the way? Pretty good I thought, and not just because it featured a colleague from just down the corridor at work.)
1500s is entirely plausible - I've done it through parish registers for one of my lines. It's quite possible if I could hone my palaeographical and medieval/renaissance Latin skills I could get further back by looking for wills and other documents.
Obviously you're only going to get back beyond whenever it was in the 16th century that parish registers were introduced if your ancestors were "someone" - not many ag labs are going to have left a trace in the registers.
So - if you're very, very lucky - it's going to be possible. There's a book by Paul Chambers on Medieval Geneaology. Not read it, so no recommendation.