If you want to know "how they did it" you'll have to ask them yourself. Despite some hype, Lima was never released, perhaps because Saurik (and others) talked them out of it. If you want to know WHY it wasn't released, and why Saurik and others might have wanted to discourage them, read the above thread.

If you still want to write an iPhone app that does something like this, good luck.

Edit:
If you're thinking of a JailBreakMe type exploit - something you can use to download and install your application on ordinary, un-jailbroken iPhones, just forget it.

Yeh I mean how did the jailbreakme website let iPod users download stuff when not jailbroken

Before Jailbreakme 3.0 came out it was using a PDF exploit. But I'm not sure if they still use that method (I think it was fixed in 4.3.1) or some other method, either way, it only works for 4.3.3 and below.