Generally temperature and how hard things are pushed mainly determine life.
Quality inverters should last a long time, cheap msw ones may only last 5 years,
As a kid I used to repair radios and tvs, then electrolytics were troublesome, carbon pots ( volume controls and similar ) were dreadful and still are. The old carbon rod resistors were fairly reliable if not pushed, when pushed to full rating failure was regular.
Paper capacitors became leaky and certain makes were notorious.
Valves ( tubes) survived well in certain applications, in radios the low power ones lasted well, the output and rectifier needed changing regularly.
Valves were an absolute pain in anything where the characteristics were important, in the line and frame circuits of a tv or in any digital device such as the early Racal counters they were real trouble.
Industrial electronics not built to a price survived much better, much of the older test equipment had a good long life.
The semiconductor era generally improved lifetime as the power dissipation was reduced drastically. Resistor failure is a thing of the past, plastic film capacitors came in about the same time and solved the capacitor problem except for electrolytics. Electrolytics have got much better and when not pushed and kept cool they give little trouble, I have some audio amplifiers that have run for 50 years with little capacitor trouble. Modern consumer electronics runs them so hot that they again become a big problem.
Actual semiconductors are very reliable, there were failures with certain fast germanium transistors using the alloy diffused process but the OC71 still keeps going.
Some of the early 741 op amps have gone noisy or failed in some of my kit but they were introduced a long time ago.
For something built to a standard rather than a price such as a good inverter you should see 20 years, consumer junk from China usually goes out of fashion before it dies, life expectancy is unlikely to reach 5 years.
Repair now is near impossible except for changing boards unless you are very young, I can't see well enough to go messing about with surface mount stuff on boards. Changing fets and capacitors is possible but I find it near impossible to mend anything without a circuit diagram and usually you can't get it for anything other than the high end devices. Random changing of parts without a circuit to see what caused it has never worked for me, but a few devices may have weaknesses that someone has spotted and put on youtube but even then changing parts without finding the cause might end up in a chain reaction and a lot of smoke.
I am now forced to accept that we live in a throw away society, the saving factor is that relatively things are cheaper than ever before. In my younger days everything was expensive beyond your means, you had to save up for ages to get something and when you got it you mended it and kept it going for ever.
Flux