Yes, to the extent that the US had more peace and prosperity than, say, European states, most intelligent people with even modest knowledge attribute that not to random chance but to three major factors:
(1) The Pacific Ocean, (2) The Atlantic Ocean, (3) The extremely small number of remotely near-peer powers that have ever existed not separated from the US by (1) or (2).
The rest of the Americas benefit from (1) and (2), but most other countries have done less well with (3), in large part due to the US, which has had its “peaceful” hands in much of the conflict in the hemisphere.
In the same time, the US has had the Civil War, and January 6. That's "relative peace and prosperity".
The two are related.
> If you look at, say, France, in the same time they've had their revolution
A major factor in which was allegations of the King conspiring with the governments of peer rivals against the interests of his subjects.
> then Napoleon
Who rose to power through (and as the Directory was bankrupted by) the Coalition Wars.
> then back to monarchy,
Imposed by the victors after Napoleon’s Empire was defeated in interstate war.
External security and domestic stability are not unrelated.