If a code base doesn't change too much in side or original intent then architecture and design (if it was good in the first place and is continued to be followed) will probably keep it fairly maintainable.
In a lot of cases though codebases slowly grow until they become of a size that requires a different architecture or approach to organising the code, especially if the number of collaborators increases too. It's quite a hard thing to spot and then address while that codebase is still quite active.
Rewrites are tempting to be able to apply that architectural change but often you can be quite bound by the implementation specific behaviour of the original system.
It might be interesting to look how the linux kernel has changed internally as it moved from a single person project to what it has become today.