Kernel modules allow adding and removing functionality from the Linux kernel while it is running. Modules are compiled as ELF binaries with a .ko extension and are loaded and unloaded using commands like insmod, rmmod, and modprobe. Modules can export symbols to be used by other modules and have dependencies on other modules that must be loaded first. The kernel tracks modules and their state using data structures like struct module to manage loading, unloading, and dependencies between modules.