REFER is responsible for the management of the infrastructure (lines, stations, buildings, etc.).
CP is a rail operator which uses the lines managed by REFER.
REFER’s main aim is to provide the public service of full infrastructure management of the national rail lines, including the construction and modernization of said infrastructure.
CP is the company responsible for providing national and international rail transport services for passengers. It is one of REFER’s clients, as is FERTAGUS, companies which pay to use the national rail infrastructure.
In broad terms, CP represents the trains and REFER represents the lines and stations.