I really struggle to understand the difference between those two...
Permanent establishment is about where work is done.
If you register your company in the Bahamas, but you really live in
Spain and the company has no other employees than you and you basically do everything from your apartment in Spain, then the company is taxed like a local Spanish company. It would be very easy to prove that the company "is just you" and that you are in Spain, so the company should be taxed in Spain.
But imagine a company that doesn't do much. For example, a company that owns your company logo/trademark. Imagine this company is registered in the Bahamas and you have a desk in a co-working space in the Bahamas and a part-time employee who checks the mail twice per week. You go there 2-3 times per year to have a board meeting. The company otherwise doesn't do much, it just owns the trademark. Now your Spanish company pays 1M per year to the
Bahamas company for being allowed to use the logo/trademark.
The logo/trademark company has no PE in Spain - after all, it doesn't do much. What would the activity in Spain be? No works is done, it just passively owns the trademark, that can be done by your part-time employee in the Bahamas.
So it would be very difficult for Spain to tax this company.
This is why
CFC rules were introduced: They basically say "Ok, even if no work is done in our country, if the
owner of the company is in Spain and the company is in a tax haven, then we still will tax this company like a Spanish company." (a bit simplified, but this is the idea)
Usually there are additional rules like "Only if >50% of the company's income is passive" etc. - they usually wouldn't count it as a CFC if you had a hotel in the Bahamas, for example. CFC rules are mostly about destroying setups like the above where someone wants to use a shell company to hold trademarks etc. and thus shift profits to a tax haven.
If you have an operative business, CFC rules usually don't matter, because they can just check where the work/management is performed, and then tax the company based on that.