Dear student,
There are mainly two roles of solar cells in space probes which are;
1) These cells directly convert light into electricity using a process called Photovoltaics.
2) They supply power to run the sensors , active heating and cooling, telemetry
Regards