Sometimes horses buck as an action of play. They just have excessive energy, things are going their way, and they buck to release play energy.
Bucking can also be a response to fear, anger, or pain. When a horse can’t run away from what is causing it to have these emotions, it reacts by bucking and kicking as a “fight or flight” response. Sometimes it is a sign of aggression and sometimes it can simply be a behavior problem with that particular horse.
If your horse bucks often and without obvious reason, you may need professional help to deal with it. If it doesn’t happen often or consistently, checking your equipment and your horse carefully for a reason is your best answer to stopping the behavior.