Well it's simple. About the time I was learning to program computers, people were continuing to build electronics smaller and smaller. They consistently crammed more and more components onto silicon. The first one I ever saw was the Intel 8080. Rather that totally replacing the old computers, humans upgraded and improved them.
Computer programs can be very hard to understand and edit when they are written by someone else.
To save time and effort, programmers often start from the bottom up and write libraries, or toolkits of simple bits and pieces of programs. Later these toolkits are put together into a completed program. Libraries are often used over and over again within many different programs. Companies specialize in writing these libraries. As you can imagine, some of the code inside these libraries can be quite old, even if the programs were written recently.