There was an interesting example of this when I took a course modern Middle East history in college.
I forget the exact time period, but basically in pre-modern times Islamic law said that you weren't allowed to pass wealth onto your children. To get around this, the wealthy would found charities and give their kids cushy jobs running them. Even though a lot of the charity's money was presumably routed to giving the kids a lavish lifestyle, this system still resulted in the Middle East having the best social welfare system of the time period.
I forget the exact time period, but basically in pre-modern times Islamic law said that you weren't allowed to pass wealth onto your children. To get around this, the wealthy would found charities and give their kids cushy jobs running them. Even though a lot of the charity's money was presumably routed to giving the kids a lavish lifestyle, this system still resulted in the Middle East having the best social welfare system of the time period.