Computers will go for many years sometimes without needing repair, but that's not always the case. Moving components like hard drives, printers, and cooling fans can break down over time, like any mechanical parts, and when they do, they'll need to be repaired or replaced.
Batteries on laptops and tablets don't last forever and need to be replaced over time when they cease to hold a charge.
Other parts of a computer can fail as well, including microchips like the central processing unit, the graphics card or memory chips.
Screens and monitors can deteriorate over time, necessitating repair or replacement.