One of the pillars of Islam is the requirement that Muslims share their wealth. In Arabic, this is called zakat.
Muslims are generally expected to give 2.5% of their wealth to be used to help the poor. The general rule is that a Muslim is required to give this 2.5% on anything that they have held for at least a year, not just on what they have earned in the current year. There are some Muslim countries where this money is collected by the government and is legally required. However, most Muslims give the zakat by leaving the money at their mosque. Not all Muslims are required to give this. Instead, there is a provision that those who have very little wealth are not required to share what they do have.