Residents of any EU country must declare their worldwide income and pay the due income tax in the respective country. But this is in conflict with the other rule which
states that tax should be paid in the country where the income in generated.
To resolve this situations countries sign double taxation treaties. The following study case may help to understand this better...
A national of an EU country residing permanently in Spain where his income is generated and covered by the double taxation treaty. Additionally, he owns a property in
his home country which he rents. He also has some investments in his home country and he received dividends.
What about tax rates and allowances?
The applicable tax rates and allowances are, of course, the Spanish ones. In some cases there may be a situation where there is a remaining tax bill in Spain.
If you consider the rent example as the only source of income. If he was resident in his home country, he would have to pay any tax for that specific amount of income because the allowances given in that country will apply to the tax bill. Whereas in Spain he the Spanish tax rate is applied as well as the Spanish tax allowance. This might result in a payment to Spain Tax Agency.