You might consider reading and understanding the articles you link.
From your one on the military;
...
Although the US significantly outpaces all other countries in total military spending, military expenditures relative to population size present a different yet crucial perspective. Analyzing defense spending per person highlights how nations with smaller populations commit a larger share of their resources to military efforts.
Looking at per-capita military spending from 2009 to 2019, Middle Eastern countries occupy six of the top 10 positions (the US is fifth). The United Arab Emirates spends an average of $3,198 per person on the military each year, compared to $2,798 in the US.
...
&
Another way to gauge how much countries spend on their military is by measuring the proportion of military spending to GDP. This helps illustrate how much the state values national defense compared to other key economic sectors.
Measuring this way — again, from 2009 to 2019 — North Korea ranks at the top, with 23.5% of the country’s GDP coming from military expenses on average. This far outranks every other nation; the second-highest, Oman, comes in at 11.8%.
The US comes in 21st on this list, at an average of 4% of its GDP.
....
Also, consider the data at here;
They show about 3.5+ times as much spent on Medicare/Medicaid & Social Security as spent on Defense.
When it comes to defense, one needs to consider;
1) Relative purchase power of currencies being compared. Wages and costs of living in CCP China are a lot less than USA when you do the currency exchange rate comparisons.
2) USA has better pay and benefits for it's military persons than most other nations.
3) A lot of the world's R&D for military starts in the USA before going on to other nations.
You are comparing apples to potatoes so to speak.