It's all about the frame of mind when rewriting whatever code we're referencing to.
If you're rewriting to just throw out the past, you're in my opinion likely to not care what the current code does in detail. Which likely ends up with "new" history lessons coming - when you need to iterate over this rewrite and fix stuff you didn't think about.
If you're rewriting a section/whole program to merge/extend it, I think you're more likely to try to get a good grasp of what it does to a larger extent and keep bug fixes and quirks while baking new code and refactoring some old code.