If you're asking how it's setup/configured, then Valve ships "Steam Input" that can do a lot of things and one of them is translating gyro data to mouse events.
Some games support gyro directly, but even then AFAIK people prefer Steam Input due to how configurable it is.
More like, how does gyro help you play some games?