A transmission service is to the transmission, what an oil change is to the engine. The main purpose is to get all the small particles and metal shavings that can wedge between moving parts and clog passages in your transmission, causing wear throughout it. Draining and changing the fluid helps to eliminate the particles and the wear they cause.
A transmission service includes removing and examining the pan (when possible), replacing or cleaning the trans filter, cleaning the pan, reinstalling the pan with a new pan gasket, and, finally, removing the old fluid and replacing it with new ATF fluid. For some vehicles, adding a friction additive is recommended, but this is model specific.
The purpose of a transmission fluid service is to provide better lubrication, improved holding power between the clutches, and reducing heat in the transmission. With regular maintenance, your transmission will work better for years longer and will be less likely to have major issues or breakdowns.