I rarely upgrade or replace. I have a bike that I raced and train on that I bought in 1984 and it has over 150,000 miles on it, the only thing I upgraded was the rear cluster from 6 to 7 speeds and I think that's all I ever did besides the usual wearable stuff, the big wearable thing was the wheels which my last upgrade was to Torelli Master Series rims from Mavic which I can't recall the model.
Most of the time there is no need to upgrade or replace. If you maintain your bike the components should last a very long time, and if something does require replacing then figure out if you upgrade what benefit will the more expensive upgraded part will give you and whether or not that benefit is worth it to you. Replacing a bike depends on if a person has a low end bike but gets serious about riding and wants a better bike, or, like in my case, the bike is 30 plus years old and it's time to get new one because I didn't want to put more wear on vintage components, and I wanted a titanium bike for a bit more riding comfort plus the frame will last forever.
The average rider usually won't benefit from buying upgraded parts, nor will they benefit from buying a more expensive bike.
When I bought my last new bike, the TI job, I upgraded a few things BEFORE I took possession of it because I could swap parts and only pay the difference between what the bike came with and what I wanted, so I swapped the rear 105 derailleur to Ultegra, standard Shimano cables to DA9000 cables, low end FSA headset to Cane Creek 110, and lastly a generic carbon fiber fork to Enve 2.0. And basically I can't see any reason if something fails to upgrade to say Ultegra brake levers from 105 because the 105's work just fine as does everything else that is still 105, so I would probably replace whatever failed with another 105 component. I don't suspect any of my components to fail for at least another 15 years, and as history of components go the Dura Ace technology today will in 7 to 8 years filter down to 105 so by the time I have to replace something I'll get older Dura Ace technology labeled 105 for cheaper then the DA cost when the technology was new. My wheels will probably wear out first, and I will probably upgrade those when the time comes but I won't go nuts on the wheels either since I don't race, so I'll look for the best aluminium wheel for the price.
Obviously this is just the way I do things, there are people that will buy a new bike just because a crank for example failed, or buy a new bike every 5 years because they think they have too many miles on the bike (which may only be 20,000 plus or minus for a person that constantly rides), that's fine, that's their thing, but I'm a tightwad so I can't see doing that and find any logic in it financially. However carbon fiber frames is a different story, there is evidence now that says that CF frames become soft as the miles go by, not sure how many miles that is but there is definitely an issue with that, and once a CF gets too soft it can simply snap. So CF riders will need to replace their frames a lot sooner than aluminium, steel or titanium, in fact the last two you will never need to replace those.