Generally, the result of US diplomacy and projection of power over the last 50-75 years has been hugely beneficial and highly cost effective for the US. Why does anyone invest in anything? Because they want to see a return. The US has seen this in spades, as have (in general) its allies.
You can see this right now in Ukraine. The US and its allies are busy donating/selling all of their soon-to-expire weapons, their older model (but still good) jets, their brand new weapons. Who benefits from this? Ukraine, now. But also the weapon manufacturers, who represent a non-trivial proportion of the US economy. If Ukraine wins the war, it will be paying off its debts to the US for a century, with interest.
An economic example might be the sanctions it placed on Russia along with its allies. Russia is currently forecasted to see a 20% drop in its GDP this year, probably the single biggest effect of the war (compare to Iraq, Afghanistan, Syria effects on the US). Lots of the sanctioning can only be done because most of the global economy runs on the US dollar, as opposed to the yuan, yen, pound, euro, because the Russian loans are dollar denominated. If someone's putting the pressure on the US in some way, its various investments let it wield some massive clubs.