The Common Reporting Standard (CRS) is the requirement of reporting and gathering information, being obligatory for financial institutions worldwide.
Acting in the light of the CRS regulations, a Bank is obliged to determine where its customers should pay taxes (which is often associated with determining the tax residence). The bank collects the data which it already has about its customers, and it can also request missing data to be delivered.
If it turns out that the customer is a tax resident of a country other than that in which the bank accounts are held, the Bank will forward such information to the local tax authorities. The tax authorities may then exchange this information with the tax authorities of the country of residence.