The necessity for an A1 certificate (within the EU/EEA and Switzerland) or a Certificate of Coverage (CoC) (outside the EU/EEA and Switzerland) is influenced by international agreements and your specific circumstances.
These certificates are generated under the following conditions:
you are on a payroll in the EU / EEA, CH or UK
you are on a payroll in another country and this country has a social
security agreement with your destination country.
These certificates serve as proof that you continue to pay social security in your home country, thereby exempting you from paying social security in the country you are temporarily working in.