The concept of cost sharing flights implies flying with an aircraft while the costs are shared between all passengers onboard the aircraft, including the pilot. The pilot pays a contribution to the direct costs.
Cost sharing flights are carried out by qualified local pilot. There can be no profit for the pilot as these flights are not commercial. Pilots share their passion for flying with passengers and, at the same time, maintain or improve their pilot proficiency. Therefore, cost sharing flights are far more affordable than typical aircraft rentals.
More information can be found on the EASA web site (European Union Aviation Safety Agency) and EASA regulation.