The biggest problem is that wages have been stagnant across the board for the military, and thus they have a poor retention rate... and since we're getting back to the 'good old days' of how Congress treats the military (i.e. poorly) with plenty of enabling by various groups...
... have fun keeping the world from going back to having a major world war every generation (or less) if you can't ensure that the military can actually function (and thus keep the price tag of trade at literally bargain bin/practically free prices)...
... yeah, the stuff you discover when you do research for a future-history setting. People who don't understand things think that nukes prevent war, the actual reality is less 'nukes' and more 'trade'...
As one who's left the military in the last decade I can attest it isn't necessarily the pay, although if all of the other contributing factors suck, then it is the cherry on top. After a while constant deployments, overused, undermaintained equipment, lack of new hardware to replace old equipment, known persons with toxic behavior put into leadership roles for "diversity", senior leaders who get caught violating UCMJ who don't get punished, career fields with half the promotion rate of all line officers, the job was fun when you were single but sucks now that you're married and have kids, the cross career experience tour was better than your core job and flesh peddlers won't let you ever go back, the job is good or sucks based on who wins the next election, your boss sucks and hates you for keeping him out of jail b/c he's too lazy to learn the legal requirements of the position he holds, ass kissers and back stabbers get BTZ's while kick ass take care of your troops guys get in the zones, they gave you a bonus 4 years ago to stay in and now 4 years later they give you a bonus to get out, the boss sucks, so does their boss, oh BTW it's your turn to go back and spend 6 months in the sand box, is a 50% pay check really worth putting up with all this shit for another XX many years?
This isn't an all inclusive list, only things my friends or I saw, or complained about since we commissioned in the 2000-2004 time frame.
Oh, back to the pay issue, officer pay increased 19.7% from 2012 to 2021, same grade and time in grade. Since I left, my base salary in a completely different field only increased 18.3% in the same time frame, there are a ton of caveats to be had, but the pay raise piece looks to be in line with what's outside (the base salary is much bigger, but the benefits are different). In my case the operational experience tour career field was way better than my core career field, but I signed up to fly planes and kill bad guys which they wouldn't let me do that b/c I made the mistake of getting two engineering degrees, which they they didn't pay the tuition. Then when given the chance to pursue a free MBA from a top 3 ranked program they viewed my entrance to the program as a decision to not pursue a military career because it wasn't through the established PME track.
At the end of the day, was it the XX% jump in base pay, or the fact that everything that made the military attractive when you raised your hand and swore your oath, now sucks Y/YY many years into the journey. If it's the latter the former is icing on the cake, if it's the former you probably wouldn't have raised your hand in the first place.
All of this to say, once you decide that the military isn't for you, pay only determines which of your post military careers you select. In other words, if the oil job pays 50% more than the aerospace job (that pays 10-20% more than the military job) and has better benefits (the oil job, than both the military and aerospace) then choosing that option isn't being seduced so much as making a rational decision. Which doesn't even begin to introduce incentive pay, which is to say performance based bonuses, stock bonuses, etc. aren't different (they are, aerospace offered a 3% bonus, while oil offered a 15%, starting, bonus that increases by 5% every promotion, and stock, you get the idea...)