In general, lenses capable of auto focus that are dependent upon a motor in the camera body are older designs. Among lenses made for systems with cameras that may include a focus motor in the body but that also include camera models without focus motors in the body the lenses with focus motors in the lens are the newer, more up-to-date designs. Newer, more up-to-date designs tend to perform better optically than older lenses within the same class of lenses. They do this not because they have SW/HSM/USM/etc. focus motors nor because they have VR/VC/OS/IS/etc., but rather because they are also newer, improved optical designs.
By far the most lenses that require a focus motor in the body are Nikon F mount lenses or third party lenses made for the Nikon F mount. Even though some might still be in production, the optical designs are the same as when they were introduced sometime between 1986, when Nikon introduced their first AF lenses that all required a camera with a focus motor, and 1998, when Nikon introduced the first AF-S lenses with the Silent Wave autofocus mechanism built into the lens. (Nikon introduced AF-I lenses in 1992 that had built in geared focus motors, but only in their super telephoto series of lenses because the focus elements in those large lenses were too heavy for the motors included in the Nikon camera bodies.)
At Nikon, image stabilization was still a couple of years away from getting off the ground in 1998. Nikon's first VR lens was introduced in 2000, and it was an AF-S lens with a Silent Wave Motor in the lens. All of the Nikon VR lenses of which I am aware are AF-S lenses with focus motors in the lens.
In theory it is possible to have a Nikon AF (no motor) lens that is optically superior to an AF-S VR (Silent Wave motor and Vibration Reduction) counterpart. But in practice no such lenses have been produced. All of the R&D has been aimed at improving the more modern lenses because those are what the market is most interested in buying. So the answer to your question with regard to Nikon is, "Yes, it matters because only lenses with focus motors inside the lens even offer in-lens stabilization."
The same is true for Pentax. No new F, FA, D FA, DA, etc. lenses have been introduced without also having focus motors in the lens (designated by a "DC" or "SDM" in the name of the lens) since the first Pentax lenses with built-in motors were rolled out. So all improvements in optical performance made over the last decade and a half have only been applied to lenses with built-in focus motors.
Pentax implements stabilization in the camera body rather than in the lens. This means any lens used on a Pentax body gains the benefit of the stabilization capabilities of that body. It also means that longer focal length lenses that need the most stabilization get the least benefit from in-body stabilization. The same amount of camera movement creates more blur with a longer focal length lens than with a wider focal length lens and thus requires faster and more extensive movement of the sensor to compensate to the same degree. So the answer to your question with regard to Pentax is, "Yes it matters because the newer lenses that incorporate improvements in optical performance also include built-in focus motors. It also matters because in-camera stabilization is inherently less effective at the focal lengths where it is needed the most when compared to lens-based stabilization."
With Sony/Minolta newer lens designs all have built in focus motors but no built in stabilization. And while they may try to sell you on the argument that putting a focus motor and stabilization in the camera body makes the non-stabilized lenses with no focus motor needed cheaper, a comparative look at the prices of Sony's non-stabilized lenses versus Canon's/Nikon's stabilized lenses indicate there is little if any difference in price between lenses that are otherwise comparable. Even third party lenses that include stabilization for Canon/Nikon mounts are priced very close if not identically to their non-stabilized Sony mount counterparts. So the answer to your question with regard to Sony is, "Yes it matters because the newest optical designs are only offered with lenses that include built-in focus motors in the lens. It also matters because in-camera stabilization is inherently less effective at the focal lengths where it is needed the most when compared to lens-based stabilization."
Canon has never produced a mass marketed DSLR body with a focusing motor in the body. They've also never produced a DSLR body with in-camera stabilization. They created the all electronic EF lens mount for their brand new EOS system in 1987. Every EOS lens with autofocus capability has a focus motor in the lens. Every EOS lens with image stabilization capability has the IS built into the lens. No EOS camera uses a mechanical connection between the body and lens to control any aspect of the lens: focus, aperture, or stabilization. So the answer to your question with regard to Canon is, "What's an autofocus motor doing in the body? In the semiconductor/information processing/high speed micro-servo/ring type ultrasonic motor age, why on Earth would anyone wish to do that?"