It's mostly oil countries that have a sovereign wealth fund and it comes out of the oil money. Norway, Saudi Arabia. Idea being that oil is a limited resource with a lot of value and the proceeds should be used to ensure everyone's future.
Of course the US IS an oil country...