By the time most of us were turning 30, about half my cohort of friends and colleagues had given up as developers. By the time I turned 35 almost everyone had. Out of about 30-40 people that I have been somewhat associating with during my career, I can only think of about 5 right now that are still in tech. Four of those five are in management roles. Only one of those people is still a "true developer" (pushing code and commits all day). The rest have moved to infrastructure, security, and related fields.
The ones that left. A surprising number moved to rural areas to slow down their lives. Building homesteads (small personal farms). One actually built a large-scale mushroom farm (culinary/legal mushrooms). A few teach. Quite a few retired early doing the FIRE thing (wish I had been disciplined enough for that). Several are expats. So for the most part, most of them went off to do things that were less chaotic and less stressful.
I almost quit myself in my early 30s. But I was fortunate enough to get promoted into a senior management position, where I am mostly focused on tech strategy and not true "developer work" anymore. I also went back to school and joined a PhD program where I started doing research on encryption and security in something that truly interests me. So that kept me sane. At this point, I am "resting and vesting" at my current job, waiting for them to sell, which they are extremely well suited to do right now. As soon as that happens, I doubt I will find another job in tech. I plan on taking my PhD and staying in academia.
This is anecdotal experience. So your mileage may vary. The pandemic hit as most of us were between 30 and 35, which might have had a disproportionate affect of taking people out of the industry too. So my experience might be more extreme than the average. But basically, I have decided that the reason tech is mostly young people is because it breaks you down as you get older and people just leave. So burnout is a VERY real thing in this industry.