A brain injury recovery and rehabilitation (at least partial rehabilitation) is possible thanks to a property of neural networks called neural plasticity or neuroplasticity. Neuroplasticity is the ability of neural networks, and particularly the brain, to reorganize and maintain its functions when a part of it stops working as before, especially through stimulation and training. This means that, if some part of the brain is damaged, a different part of the brain can be trained to assume its functions. This is particularly true during childhood, but also through adulthood.
Consider this case: you’re trying to complete a path you’ve done thousands of times to go back home from the office. But the road is closed due to an accident. So you try to take a different road following more or less the direction you know will allow you to arrive home. If you indeed arrive home, although it’s maybe a slower and harder path, you’ll learn this new path as valid, and next time you find the path closed you’ll know what to do. This is basically what the brain does: exploring new ways to do the same and strenghten these new paths it discovers if they results to be good to reach the same goals.