In the 19th century, it was observed that the sunlight striking certain materials generates detectable electric current – the photoelectric effect.
They have historically been used in situations where electrical power from the grid was unavailable.
As the invention was brought out it made solar cells as a prominent utilization for power generation for satellites.
Satellites orbit the Earth, thus making solar cells a prominent source for power generation through the sunlight falling on them.
Solar cells are commonly used in satellites in today's times.