Understanding the cost of welfare