Q.how to prune lavender
I was told if you cut into the old wood, it will kill lavender, but my neighbor cut hers back to ground level, as it wasn’t flowering very well. Yet since she did it, it has come back better than it ever has been. Why?

Sounds like your neighbor's Lavender simply reacted really well to being severely cut back -- and there are no guarantees that all Lavender plants would react that way. A good rule of thumb for pruning Lavender is to cut about one-third of the plant down -- and not until it's second full year, so that it has a chance to establish itself.
This article describes how to properly prune Lavender:
https://www.gardeningknowhow.com/edible/herbs/lavender/pruning-lavender.htm