Solar panel I-V characteristics are highly non-linear; this results in a Power-Voltage plot featuring a maximum at a given Voltage Vmpp across the panel.
As you pointed out in your question, it happens that the IV curve changes over time according to the light irradiance and temperature, and Vmpp changes, too. That's the reason why methods to track Vmpp are sought: squeezing as much power as possible from the source, i.e., the panel.
Between your panel and the storage element (battery, supercapacitor) there is an harvesting circuit, based on a (switched) DC-DC converter topology (e.g., boost); MPPT techniques are implemented inside this circuit to keep the input voltage of the harvester (i.e., the output voltage of the panel) as close as possible to Vmpp.
Therefore, when you target MPPT, the focus is on optimal power transfer from the source to the harvester (which -in turn- will actually introduce some loss itself, yep!). As RoyC puts it, optimal battery charge is another story.
Maybe the schematic below will help: the photovoltaic panel is modelled as a current source in parallel with a diode (representing the PN junction); the goal of MPPT is to keep the voltage V as close as possible to Vmpp.
simulate this circuit – Schematic created using CircuitLab
For clarity, I have drawn one possible implementation of a Boost-based solar harvester.
The IC I put in the schematic is a Schmitt trigger comparator whose task is that of keeping the voltage at its non-inverting terminal as close as possible to Vref. One can set Vref = Vmpp in order to achieve our goal.
simulate this circuit
Now: how can we generate Vref = Vmpp?
Even in this case there are different possibilities: for example, an additional timing cicuitry can be designed to disconnect periodically the solar panel load, so that a peak holder can 'capture' the panel open-circuit voltage Voc. It can be seen that Vmpp is usually an approximately constant fraction of Voc, irrespectively of the the environmental conditions. By knowing the ratio Vmpp/Voc, a voltage divider can be used to obtain Vmpp starting from the stored value of Voc.
Considerations about the schematic above:
- this is just an example of implementation: it should be noted that an external control logic is not required to switch the MOSFET on and off; instead, the comparator output accomplishes this task, which is very useful in applications where power-draining microcontrollers cannot be afforded;
- the low-power comparator draws its supply from the harvester input terminal; since this has some fluctuation (mostly depending on the inductor value and on the comparator's time delay) an RC filter can be used to smooth it.
Other possible harvesting solutions include the use of microcontrollers implementing some sort of 'Perturbe & Observe' algorithm: as shown in another answer, in this case the operating conditions are changed a little bit while monitoring the response of the input power.