Computers lifespan is determined by two main factors.
The firstly being what is known as the hardware MTBF (Mean Time Between Failures), and the second being how long the operating system is supported by Microsoft or Apple.
Computer hardware will normally last far longer than the software operating system, that they were supplied with.
You can sometimes upgrade the operating system to a newer version.
For example from Microsoft Windows XP to Windows 10, but this costs money.
Another issue is that newer commercial operating systems generally need more computing power to run. This is because they are designed to run on the latest computer hardware.
To be continued……