They have to train the horses to get used to the bang. We have used fire crackers to get ours used to gunfire. Its a lot cheaper than firearm rounds.
Some of the riders will use a horse ear plug that will muffle the sound for the horse.
I've never done it, just been around it a lot