Rules of origin are laws and procedures that determine a product’s country of origin for applying proper tariffs and regulations.
For example, a Canadian clothing brand that manufactures in Portugal wants to benefit from EU trade preferences when exporting to the UK. The rules of origin under the UK-EU Trade Cooperation Agreement require that the fabric be cut and sewn in the EU — if it was merely assembled there, the garment wouldn't qualify.