A young brain grows far more connections than it needs, then keeps the ones that get used and removes the rest. Press play and watch 20 years go by. At Normal speed, one second is about half a year.
Uncheck Music before age 5 and watch its orange pathway fade, get tagged, and get eaten. Check it again later. Does the pathway come back?
This is a simplified model. In it, removed synapses never regrow. Real brains still form new synapses throughout life, just far fewer. A human cortex has around 100 trillion synapses, and different regions prune on different schedules: visual areas peak within the first year, while prefrontal cortex keeps pruning into the twenties.
Artificial neural networks get pruned too. After training, deleting the smallest weights often costs little accuracy.