Sometimes it helps it grow when it’s barely able to do so on its own - that’s the case for the bright red and yellow ones that are popular in flower shops. They can’t photosynthetize well on their own, so grafting allows them to get nutrients from the rootstock instead.
For other ones it’s either purely aesthetics, or speeding up growth - grafted cacti tend to grow much faster. Either that, or making sure delicate ones don’t die - it’s more difficult to kill a grafted cactus, since rootstock ones are normally pretty resilient, and scions are protected from root rot and such because they sit on top :)