AF-D lenses do not have a focus motor built into the lens like AF- S or "G" lenses do. On AF-D lenses, the AF works by a screw drive system, so they require a camera that has a built in focus motor in order to turn the focusing mechanism in the lens.
the D3x00 and D5x00 series of cameras do not have a built in AF motor, and therefore require newer AF-S or "G" lenses for auto focusing to work.
the D4 has a built in focus motor and is able to autofocus any Nikon AF lens.
As mentioned you need AF-S / G lenses to autofocus on your d3x00 or d5x00. The body simply sends electrical signals to the lens which in itself does the focusing internally on the lenses .
Whereas on higher end bodies the motor is in the camera body for AF/AF-D lens support. Higher end bodies can also use the AF-S/G lenses. And the in-body motor turns a screw (which you can see on the mount - it looks like a miniature standard flat headed screw driver tip) which turns the lens gear for focusing. AF/AF-D etc lenses require the body to have a focus motor in them.