Windows (indeed, pretty much any operating system) includes some base level functionality drivers that can handle the vast majority of devices. Unless you have some device that was designed (very poorly) to have nonstandard functionality, the ones that come out of the box tend to do the job. This is all in the interest of ease of use and installation for the standard user, with these sorts of very predictable devices. It doesn't know what kind of keyboard or mouse you have - it doesn't need to.
For most users, this is most obvious with, say, a fancy mouse and keyboard - often you get basic functionality out of the box, but you don't get any of the extra functions until you install the manufacturer's drivers. It's also the reason, for example, that you still get video output (albiet low resolution) even before you install the video drivers - there's a base level driver that's good enough to function.