AFAIK macbook's keyboard and touchpad has a dedicated chip to handle user interactions and is possibly part of the firmware. This explains why it works on Apple EFI level and it works smoothly even on high CPU load.
https://hawkwood.com/archives/743
Here's a closeup of the chips:
https://hawkwood.com/wp-content/uploads/2009/09/IMG_3578.JPG
CY8C24794: Converts SPI to USB. [1]
SST 25WF020: 2 MBit serial flash memory. [2]
BCM5974: Multi-touch controller. [2]
TI CD3238: Driving IC. [3]
[1] https://www.insanelymac.com/forum/topic/333175-macbook-pros-...
[2] https://appleinsider.com/articles/10/07/29/teardown_of_apple...
[3] https://www.semisrael.com/blogs/technology/ti-touch-screen-c...