Cathodic protection and earthing are two different topics belonging to the opposite sides of the spectrum. The implementation and principles are actually different. To simply illustrate what I mean, for cathodic protection, the potential of the structure concern is being raised above zero to mitigate corrosion While earthing will pull down the potential of the structure to zero particularly during a fault to provide protection from electric shock.
In pipelines, particularly when a power source is not available, sacrificial anodes are being used. Likewise, these anodes are also used as earthing medium for the pipes.
Electrical standards clearly states that earth electrodes materials should be able to withstand corrosion and have adequate mechanical strength. That is why, we normally use copper earth rods to comply with this requirement.
In cathodic protection however, if they are using sacrificial anodes as the earthing electrodes, then it does not comply with this requirement as anodes will be corroding and ultimately disappear. When this time comes, there will be no earthing provision at all for the installation.
Basically, there are two purposes of earthing,
a) Protective Earthing - intended to limit earth potential rise in an installation.
b) Function Earthing - intended to provide correct operation rather than safety conditions.
Cathodic protection belong to the second category. However, there are some cases that these two are combined, in which case, the requirement for protective purposes prevail. In other words, cathodic protection should not reduce the integrity of the electrical installation protective earthing system.