(simplified) When you press a key on your keyboard, a keycode (e.g. 116) is sent to your computer. This keycode has to be converted to a symbol an application can understand, like an "a" or a "Space". The X window system contains a tool called xmodmap with which you can change the assignment of the keys - this is the point we interfere.