It draws on the screen what programs and the desktop environment tell it to -- including opacity, tiling, clicks, drags, updates, etc. Everything you visually perceive on the monitor is the product of the compositor.
Okay but why is it seemingly always associated with gaming? Anytime someone mentions Linux gaming, I often hear people asking them if they're using Wayland.
I'll step aside for a longer answer on this one. But, I can say that for my usecase (which is mainly gaming on my home PC on an all AMD build with KDE on Arch) it is noticeably and measurably faster than X11. We're talking 2-15 (the median is around 4 or 5) FPS depending on the game on 144hz screens.