3 Answers
3

It's a way of dynamically loading code into the Linux kernel, which the lowest level part of the GNU/Linux operating system. Windows device drivers are often used for similar purposes. You can read this somewhat old FAQ. Some things have changed, but the basic idea remains the same.

To have a piece of hardware work, you need a driver for it in Windows, and you need a device driver kernel module for it in Linux.

Device drivers need to directly access hardware and therefore run in kernel mode. Normal user applications run in user mode. A user mode program has the protections of the CPU's MMU and cannot interfere with the operation of another user mode program or anything running in kernel mode. Things running in kernel mode do not have this protection, but can access hardware directly. So this is why they are called kernel modules.

You can build your own Linux kernel, and incorporate modules into the kernel. They then cease being modules at that point and are part of the kernel. Usually it's beneficial to only build in a small number of drivers needed for booting and let hardware detection load the rest of what's needed, although you can build a completely "static" kernel not relying on loading any modules if you wanted.