For CPU's, it really doesn't. When we're talking within single digits for half the price, it's not really a little money either. Going with a 14900k over a 14700k or a 7950x over a 7900x is not going to allow you to put off an upgrade another generation or longer. The extra threads will rarely be useful, and the low threaded performance is so close among the CPU's in a single generation that you're not affording yourself any extra time spending more on a higher end cpu. Knocking $200 off your CPU budget while only losing 5% or so performance will land you a higher rung Blackwell GPU in a few months that will likely net you more than 5% and more consistently as well (not 15% some games and 0% others).
9800X3D will be absolutely fine for gaming in 4 years especially as you go up the resolution chain just as a 12600k is perfectly acceptable for the overwhelming majority of gamers today. The people buying a 9800X3D today are not making a rational decision based in logic. In a few years from now, when they look at the rankings and see the 9800X3D way down the chart like a 5800X3D is today, they're going feel like they are missing out on something, when they really aren't, and are going to get the upgrade itch again.
You are mostly correct. There is a single question regarding upgrades. Do I get the frame rates I want in the games I want to play? (Assuming it is achievable, today you won’t see 400fps in Starfield)
If you have a strong processor as a base, your gpu is running at 100% and you can’t achieve your desired rate then upgrade the gpu. If the processor is weaker and your gpu is running at (for sake of argument) 50% then upgrade your cpu.
Buying any intel 12 and later 700 class and upper will give you decent longevity, same can be said for the 5800x3d (waning but still relevant), 7800x3x and 9800x3d. For the performance the 9800x3d offers it isn’t overpriced. It is head and shoulders above the competition (across all the reviews I’ve seen) with incredible 1% lows approaching the averages offered by its competitors in many cases.
Granted, it will become relatively weaker as the competition improves just as its successors will make it look less compelling. Its price will come down to some extent.
Replacing your processor? Does it allow your gpu to give you your desired frame rates? Save your money if yes.. replace if no.
I personally go by the idea “buy well, buy once” and I tend to buy above what I need at the moment I am making a purchase. With items with a finite period of relevance e.g. CPUs I tend to change every third generation, last was a 3900x (star citizen is a processor hog so the jump to 9900x is a huge jump and I do see smooth gameplay with the 9900x, I wasn’t seeing the same with the 3900).