What happened to me is that I went from being _the_ key employee who built and architected major parts of everything, to slowly but steadily being stripped of every single task, meeting, project, in favor of new people who were brought in to cover those areas they had experience with on their resume (but not necessarily performed at a higher level even after their ramp-up period, in my obviously biased opinion).
In the end (after about a couple years from my productivity peak) I ended up as a completely disposable resource, with literally nobody paying attention to anything I had to say. It surely was a very tough mental exercise for me, I had to brain dump all I knew about the technology to all these new hires dozens of times, knowing that they would completely replace me in months and leave me task-less, which they did. I had crazy impostor syndrome constantly thinking "do I suck this much that they are replacing me for everything?" (the answer was no: I was able to obtain job offers from 4 FAANG companies, and I joined one).
The worst part of all is that nobody will tell you what's going to happen, your manager (manager that you didn't have when you joined since you built the damn thing when nobody was even around!) and everyone around you will keep praising you. But each and every single day, one little piece of the puzzle will be taken away from you and given to the new hire with the shiny experience on the resume.
What "saved" my mental sanity is that I am a good negotiator and so I was able to negotiate a decent equity package at the beginning and put it in writing in my contract (2%+). Unless the company is doing particularly bad business-wise, screwing up common shareholders, especially if you early exercise, it's not that easy, so throughout all this period I took comfort in the fact that I was still likely vesting more shares than anyone else non-exec who was brought in to replace me.
I have left that company now, but so far it paid off, since I've already been able to obtain some liquidity for those shares by selling some of them to private parties. In the vast majority of cases, it would have been worthless as startup equity ends up underwater.