Usually I replace a smartphone because it has some hardware fault that makes it unusable and it is hard to repair or the cost of repair vs capability is not very favorable.

Even if I was replacing smartphone before they died, I would probably sell them anyway. Do people really have various phones in working order waiting in a drawer?

Hell yes and even tablets.

I keep everything. Usually I use it so long it's not worth selling it anymore anyway. The problem is even old tablets are often too slow to use for something as simple as home automation control because home assistant uses so much JavaScript

Usually I replace my phone when the battery is almost dead and a full charge doesn't last more than a few hours. At that point the phone is usable but not good enough to sell. I usually keep it as an emergency backup phone

For some reason I tend to break screens way before the battery dies usually. I am not afraid to replace a battery or even a screen if phone is not totally out of date. Having said that there seems to always be a point when they start acting semi eratically or stop booting.

I had a totally outdated and probably insecure Samsung S6 edge 2 years ago that started rebooting randomly. I think that prior to that it was so old I could only install stuff from f-droid and aurora because roots certs installed on that old android version were too old for playstore to work. Too bad as you can't easily find smartphones in similar sizes anymore.

Knocking on wood my pixel 6a still going strong after 2 years.

You might as well buy a new battery then

Did that for 20 € for my Oppo Find X3 Pro at my closest tech store and saved me from buying a brand new phone

I damaged the screen of my pixel trying to open it to replace the battery. It was literally booby trapped to self destroy when trying to repair it

I will upgrade when my device is many generations out of date. So no one really wants to buy one and I will then buy not the latest but a generation or two “out of date” so it’s cheaper. So I have a heap of phones over the years that no one wants. Not even me.

I try to get rid of my old stuff ASAP, it reduces clutter both physically and mentally.

I know many people who had their old phones and computers lying around because they didn't invest the time to transfer the data. Not long after, the phone was unusable either due to hardware problems or forgotten passwords, and the data is lost forever.

I take my previous phone kayaking. Once I have downloaded the appropriate maps over wifi, I can use it for navigation, logging and photography without being worried by the prospect of dropping it in the water.

I never sell anything, everything finds a new life.

I got a Sony Xperia Compact from maybe 2016. I use it as a bicycle navigator / recorder. Recently it stopped reading SIMs, probably rusty contacts, but all I need is wifi to update OSMAnd and send me the tracks I recorded.

I also have a very old tablet, maybe 2014. My SO uses it to view movies with VLC and TV via TVHeadend.