I'm reading your question is basically "what do they do in a more expensive lens to make it better?"
There are a number of things. Quite a bit is simple mechanics: more expensive lenses get better quality assurance, so you have a lot better assurance that the individual lens you get actually performs as well as the design was intended to. Second, is pretty similar: in a more expensive lens, they can afford to use better materials -- in a typical kit lens, most of the mechanical parts are typically made from molded plastics; in a more expensive lens, many of those parts will be metal -- mostly brass or stainless steel.
These are particularly important with zoom lenses (which includes essentially all current kit lenses). A zoom lens has quite a few moving parts, and the mechanical tolerances to get maximum performance from a lens (especially a zoom) are quite tight -- quite literally on the order of wavelengths of light in some cases. As such, better build can/does translate to better optical quality.
Third, is the optical design itself. In a more expensive design it's more reasonable to use things like low-dispersion elements and/or aspheric elements. LD elements are used primarily to reduce chromatic aberration (primarily of interest in telephoto lenses). Aspheric elements are used primarily to reduce spherical aberration (primarily interesting in relatively wide-angle lenses). Most kit lenses cover a range from at least fairly wide-angle to short telephoto, so most of the designs could benefit from using both aspheric elements and low-dispersion elements -- but given the expense, neither is nearly as common in kit lenses as in more expensive designs.
Finally, at least for Canon and Nikon (most other brands build these systems into the body instead of the lens), the quality of VR/IS system varies widely among different grades of lenses. While their kit lenses mostly do include such systems, most tests confirm that they provide substantially less benefit than the versions used in their more expensive designs.
Answering the question your asked in comments: no, not all kit lenses are that horrible. Sony probably has the widest range in this regard: they used to sell and 18-70mm that really was as awful as people like to say -- quite possibly the single worst lens you could get from any manufacturer. Then, about a year ago (I don't remember exactly) they dropped it and replaced it with an 18-55mm that's a lot better. As @John Cavan pointed out, the Pentax is also quite a decent lens. Depending on the focal length and whether you care more about the center or corners, you could make a pretty decent argument for any of the Sony, Pentax or Nikkor being the best kit lens, and in any case all three are really quite decent -- at least when they're new; keep in mind the discussion of mechanical quality above, and keep in mind that it means kit lenses tend to wear out fairly quickly. At the moment, Canon seems to be the only one whose kit lens really fully deserves the horrible reputation (and I haven't kept close track -- they may have upgraded it too).
I feel obliged to add that I think a lot of the bad-mouthing of kit lenses really is somewhat undeserved though. In particular, people mostly start out with a kit lens. A few years later, they look at the pictures they took with the kit lens, and blame the lens rather than themselves for the poor quality.