As with many situations, every case is a bit different from another. While you both may have broken the same toe, it’s possible that it wasn’t the same type of break either by the actual type of fracture or where on the bone the fracture was.
Surgery is done to stabilize the bone, usually using screws or wires to hold the bone into place. If the break is clean, without any other tissue damage, and the doctor feels it will heal without surgery, then this will be the best approach.