The moving charges are an electric current, or electricity. This type of current production is called the photovoltaic effect. Such systems work by aiming large, black metal solar collectors at the sun. Black and other dark colors absorb more sunlight than light colors. Solar energy makes the collectors very hot, much like the surface of a blacktop road on a bright, sunny day.
Water pumped through the collectors is heated naturally and then can be pumped back into the pool.
Temperature sensors automatically turn on pumps to use the solar-heated water when the pool becomes too cool. Solar thermal heaters for swimming pools typically reduce water heating costs by about 50 percent. Many big pools with solar heat also use natural gas heating as a backup for cloudy days when the sun isn't shining. Photovoltaic cells, solar thermal heaters, and other solar systems have been around for a couple of decades. Johns Hopkins University Press.