Not enough info
In general, your surgeon will perform surgery to ensure proper healing in circumstances where treating the fracture
in a cast
would result in a less favorable outcome.
Getting the bone to heal is only one part of getting your hand to heal fully. There are other factors, such as the severity and location of the injury, as well as therapy, when needed that determine your final outcome.