CFC rules usually aren’t an issue for most people though as they typically only cover companies with (mainly passive) income in low-tax jurisdictions, sometimes they also only apply to corporate shareholders. An example would be if you are an Italian software manufacturer and you sell the rights to the software to a Cayman Islands company. Your company does the development and customer support in Italy (a high-tax country) and you make a profit of €1M. Unfortunately, you also have to pay license fees of €900k to the Cayman Islands company, reducing your profits by 90%. The company is not actively managed from Italy, there are︀ local directors and an office in the Cayman Islands, but it’s owned by the Italian︁ company (majority shareholder), makes most of its revenue from passive income (license fees) and is︂ in a low-tax jurisdiction - so it is a “controlled foreign corporation.”
In this case︃ all profits of the Cayman Islands company, even undistributed profits, would be added as taxable︄ income to the Italian company, according to its share size. So if the Italian company︅ owns 100% of the shares and the Cayman Islands company had a profit of €850k,︆ 100% of those €850k would be taxable in Italy due to CFC rules.
Typically, companies︇ must have mainly passive income (a restaurant in the Cayman Islands usually wouldn’t be considered︈ a CFC) and be paying significantly less taxes than it would be paying in the︉ jurisdiction of its parent company (the UK typically wouldn’t count as low-tax) to fall under︊ CFC rules.
Now on the other hand a PE is about where work is done.︋ This can be a place of management, but it can also simply be a place︌ where work is done regularly. In another thread, I made up an example where a︍ Bulgarian company sends housekeepers to work at different Italian hotels for the summer months every︎ year. It may be different workers every year, they may be working at different hotels️ every year, but every year that Bulgarian company sends workers to Italy to work there for three months. So year after year, you would be finding Bulgarian workers from that company in Italy for three months at a time. The Italian taxman could then declare that the Bulgarian company has a PE in Italy and charge Italian corporate income tax. As per the DTA, that income would not be taxed again in Bulgaria.
So basically any work you do anywhere over either a prolonged time (usually 12 months) or regularly (like in the example above) can trigger a PE. Even/especially if it’s just a place︀ of management where you make decisions and sign contracts. A PE is like a local︁ branch office of a company, subject to that country’s tax laws like a local company.︂
And then finally (but I believe this is rather rare), if a company is only︃ incorporated offshore, but all work (including management decisions) is carried out in another country, then︄ the company’s whole tax residency status can be challenged and it can be deemed a︅ local company. But I think that’s quite complex, so they would usually simply declare that︆ there is a PE.