Millisecond annealing techniques with flash lamps or lasers have become increasingly common for activating dopants and eliminating implantation-induced damage after ion implantation for transistor junction formation in silicon. Empirical data show that such techniques confer significant benefits, but key physical mechanisms underlying these benefits are not well understood. The present work employs numerical simulation and analytical modeling to show that for boron, millisecond annealing reduces unwanted dopant spreading by greatly reducing the time for diffusion, which more than compensates for an increased concentration of Si interstitials that promote dopant spreading. Millisecond annealing also favorably alters the relative balance of boron interstitial sequestration by the crystal lattice vs interstitial clusters, which leads to improved electrical activation at depths just short of the junction.