That is the problem with any all in one system.
Personally though, the hardware failures I have experienced almost always have something to do with the display system. I have had three monitors die on me. One was a CRT, the other two were LCDs. The LCD display must have had a design fault though, because one of the two that failed was a replacement for the original, it had the same problem. Mostly the components that fail are graphics cards, I have gone through quite a few of those. Probably because they pump out a lot of heat and eventually the fans have some issue or dust accumulates too much, resulting in the GPUs dieing. I have had one SSD fail for no obvious reason (that was one of the original consumer versions though - modern ones seem more reliable), and one hard drive (a portable that fell while operating, that knocked the heads out of place). I had one motherboard fail, a Dell, which used a proprietary motherboard they no longer made, so it was not repairable at reasonable cost and the whole system had to be junked as a result - one of the reasons I no longer buy systems that use proprietary components. If I can't fix a failed part without paying the cost of virtually a new system, then you don't get my business. Sorry.
Other than that, most systems I have had end up on the scrapheap because they have become obsolete, not because of some failure. Especially the last 5 or 6 years, modern technology seems to be much more reliable than the older stuff.
That said, I expect the motherboard on my current computer to die sometime though, since it has started producing random failed IRQs in the sound system. I think the sound chip on the board is failing, either that or there is some problem with the speakers that has manifested itself with age. It certainly is annoying because it causes the sound driver to restart randomly, resulting in the system display freezing for a few seconds while that happens.