When you stay longer in a company people getting in almost virtually always get a better pay. Salaries in tech aren't really following any logical trend, but internal raises in most companies do. A junior might have started at 45k four years ago and 65k today, most people don't get a 20k raise over the same period.
That being said you'll always find a friend doing the same job and getting more money, unless you're grossly underpaid I wouldn't overthink it. What matters is to be happy with what you have, if you're not move on, if you are it doesn't matter that your best friend gets 20% more. I personally enjoy having a relaxed work environment with few but serious people, 0 bullshit and no internal political games and I sure get paid less than I could if I was working for #bigtech or some random startup working on yet another bs product. I have friends paid almost twice as much as me but listening to their weekly horror stories doesn't make me feel like I'm missing out, set your own goals
What you’re seeing with salaries right now is not inflation, or at least mostly not inflation. It is supply (lower than usual) and demand (higher than usual) of certain skills. In other words it is a real market movement in the value of certain kinds of labor.
Employers can mitigate this as well, either by proactively raising salaries to match (sometimes called “market adjustments”), and or by waiting to hear an employee is leaving and then trying to match their offer to keep them.
Candidly, sometimes employers don’t actually want to mitigate these forces, but instead see it as an opportunity to trade longer-tenured employees who are entitled or jaded for newer employees who are more enthusiastic (and maybe more naive).
In any case, the only sure way to test your market value is to apply for new jobs.
I've personally left a position I liked mostly because my raises were not keeping up with inflation. I understand that at my age I'm at about the peak of what I'll earn in my lifetime: I'm not expecting a raise to earn more money anymore, but inflation still applies and so 0% raise is a pay cut against inflation. Turned out I liked the new position, but I wouldn't have risked that if my wages had kept up to what I thought I was inflation.
The budget for new hires comes from one budget line, and budget for increases comes from another.
A manager has $N to distribute among fixed number of existing employees (typically a few % of existing salary mass). They can't 2x everyone's salary. And the budget for this is approved long in advance.
OTOH they have some a budget of $X to hire M new people. They might not be able to hire M people if market is hot, so they hire fewer people at elevated salaries and still stay within the overall budget $X.