Linux hardware drivers are kernel modules. Because of the open source model and licensing of the kernel, very few of these are written by hardware manufacturers; most of them are reverse engineered or based on standardized public protocols. Pretty sure bluetooth is in the later realm, and also that things like mice and keyboards are in most cases totally generic.
The modules are part and parcel of the kernel source tree; i.e., if you download the linux kernel source, it comes with the code for all the available modules. You do not have to include all of them when you build it, of course.
Linux distros (generally) are a collection of pre-built binaries, and this includes the kernel. The kernel itself is one binary; modules may either be built into this, or separate binaries which the kernel can load and unload. Since building all the available modules into the one binary would result in a massive and ridiculous kernel, and the distros want to cover as much hardware as possible, distro kernel packages include a broad array of individual binary modules.
You can see these in
/lib/modules. Driver modules are registered with the kernel and built at the same time; the kernel is aware of what is available on the system. When you plug in some new hardware, it identifies itself to the system and the kernel chooses an appropriate driver from
/lib/modules to load.
You can see all your currently loaded modules with