Contrast detection autofocus systems work in a closed feedback loop and so the lens shouldn't cause misfocus. However phase detection AF is not completely closed loop (it's also not fully open loop), several measurements are taken and the lens instructed to move a certain amount calculated to correct the observed phase disparity. The calculated phase difference and the required lens movement are sources of error, however you would expect this error to be noticed when the next measurement is taken. It appears that when only a small phase disparity is detected the lens is instructed to move to the final position and no further measurement is taken, and this is where focus errors arise.
It's worth pointing out that the way phase detect AF systems work is not all that well understood. Most of the literature describes to phase detect systems as being purely open loop (one measurement, no feedback), however people have devised experiments to prove that with most cameras this isn't actually the case (e.g. you wait for the lens to move and then block it with your hand, the camera will continue to try and focus and wont give you the confirm beep until you take your hand away, proving it's waiting for additional measurements).
It's unclear to me exactly why phase detect systems aren't purely closed loop either, as that would seem to put all the "my lens front focuses" issues to bed. If it were for speed reasons (i.e. the extra measurement delays the firing of the shutter in many cases when the lens is actually correctly focussed) that doesn't explain why there isn't a slower but more accurate AF setting for when speed isn't a priority.
Focus shift: another source of focus problems arise due to the fact that the camera focuses with the lens wide open, and then stops down to take the image. In lenses which suffer from pronounced uncorrected spherical aberration the plane of sharpest focus can shift when stopped down. A good example of such a lens is the Canon EF 50mm f/1.2L. The shift occurs between f/1.4 and f/3.2, from f/3.5 onwards the increased depth of field makes up for the focus shift. This problem is only really remedied by knowing about the problem and compensating or manual focusing whilst stopped down.