They are completely different and incompatible.
To be absolutely clear:
strictly coincidence that the word "layer" is used as in the names ; they are not completely connected .
CGLayers is a "special" "high performance".
You can consider them “like bitmaps, but better.”
Apple sat down and said: “We are sick with people using bitmaps, let them do something better!” :-)
Indeed, you only work with CGLayers off-screen .
To repeat, CGLayers is fully used off-screen.
Once they are ready, you can blow them up on your actual screen (that is: blow them up in one of your views).
( However : note: CGLayers are often used “alone.” When I say that they are used “alone”, I mean that they are used for image processing or mathematical calculations. CGLayers are never seen on the screen, and they are completely unrelated to the screen world.)
Unlike ... CALayers are just things "in" views. CALayers is how views work.
So, both concepts are completely different.
CALayers are just "looks." Unlike CGLayers, it is Apple's "cool" off-screen, high-performance computing machines.
To be clear, CGLayers are completely unrelated to views and not related to views. (Of course, you can insert CGLayer into a view, but then you can insert “typography” or “image” into a view into a view. Typography and images are not views, and CGLayers are not views.)
A typical example:
You want to draw something complicated once, and then draw this thing many times on the screen. The answer to this problem is CGLayers. Your “workspace” will be CGLayer; you could then break it down to a printer, to a screen, or whatever.
To be clear, in my opinion, Apple had to choose a different name ...
a good name would be "CGCalculationSpace".
The fact that the name contains the word “layer” makes you think of NSLayers.
I repeat: there is absolutely no relationship. CGLayers are not even vaguely related to layers.
There is no connection at all. It really is confusing that the letters "layer" are used in the name - it's a shame !!
CGLayers should perhaps be called "workspaces" or "computing paradigms" or something like that.
Hope it helps and hope you are still reading!