For me, it’s the hardware failure. If it’s damaged enough to be uncomfortable to use, it’s done. Similarly, if it can’t run a modern browser decently.
I just ditched a >10yo laptop that I used as a server. The display was off most of the time, and the battery offered some energy backup. Its last months I couldn’t even use the power button, had to take the mobo battery out and connect it without the battery in order to turn it on. Touchpad wasn’t working either. OS hard drive was failing but that was replaced. I’m sure the thing works fine but I can’t find the right flex cables to connect the power button and touchpad to the mobo. Guess it’s going to trash soon.