It works because they act as tax havens to help rich people from other countries hide their wealth. It's not a sustainable system for every government, and it is pretty corrupt to help wealthy people avoid paying taxes in their country just so you can have a bit of their wealth in yours...