As far as I know the bulk of the magic happens in libinput - the touchpad driver. It is the DE's job to take the recognized gestures and turn them into a useful action. It is even easier in wayland, but only KDE and Gnome seem to be the ones looking into it. I don't expect sway for example to start shipping fancy animations any time soon :D