Batteries in general behave as voltage sources due to their chemistry. When current flows and charge is taken from one electrode to the other, this upsets the internal electrochemical balance and creates an opportunity for redox reactions to occur, which replenish the used charge. And the more current flows, the more reactions occur, which means the battery tends to produce a stable voltage. It also depends on state of charge and internal resistance of course.
On the other hand, a solar cell or a photodiode really is a current source. Each photon it receives results in a certain amount of charge being generated. Maximum output current, which is flow of charge, is directly proportional to the number of photons received per second. This is somewhat hidden by the fact that, if the solar cell is open circuit and no current is drawn from it, voltage will rise to the point where charge leaks back internally, so it looks like a constant voltage source. But internally, it is a voltage-limited current source.