Those large ones are large and important enough to receive substantial rewrites/overhauls when necessary. Those rewrites can be very expensive, and are completely infeasible for most software projects that don't have huge backing behind them. For small and medium projects, (code) complexity is a leading factor in maintenance, and a huge amount of unmaintainable software gets abandoned regularly, or simply falls behind and is abandoned over time.
The maintenance of giants is tied to their importance rather than the complexity of their codebases. SQLite is no less likely to be around in the future because it is simple.
Codebase complexity also isn't just about size. A huge, well-written codebase is still more likely to stick around in its current form without requiring a total overhaul.