As I understand it, quite a few countries have double-taxation agreements between themselves, which dictate how you handle income and taxation in one country if resident in another. A fair number of these (but by no means all!) have clauses in them which mean that if you are deemed to be tax resident in one of them, you are automatically not a tax resident in the other one.
In theory, this should mean that if last year you were tax resident in County A, then this year you move to Country B and are counted as a tax resident there for this year, then you pay your taxes for last year to Country A and this year's to Country B. (Leaving aside complications about income you still get from Country A while living in Country B, which may well still be paid to A with B giving you a credit for the tax already paid)
Sounds simple enough, but... What happens when Countries A and B have different dates for their tax years?
(eg you move from the UK to France on 1st Feb, and are deemed to be a French tax payer for that French tax = calendar year, how does it work with the UK tax year running to the 5th April?)