Lars has a good reply to your question. I will add some thoughts from my experience in designing MPPT converters back in years.
As you may have noticed, a given PV Panel(a.k.a Solar Panel) produces a certain voltage across its terminals when bombarded with light photons. If 1000w/m2 of light is incident on a panel, a small percentage of this actually gets converted into electrical energy, the other just stays in the form of heat(so a panel would normally heat up just as much as any other item lying in the sun).
Now coming to your question, How does your inverter know how much power is available and what is the best ‘operating point’. Depending on the topology, Most solar inverters have a Boost, Buck-Boost or a buck converter at the initial stage. This converter senses input current and voltage, and within converter’s software, these measurements are used to contineously calculate input power.
The interesting bit comes next, the inverter can control the total load seen by the panel. If I were to simplify, a panel has no clue if you have connected it to a resistive load(e.g bulb) or a more sophisticated converter. The converter’s processor can ‘play around’ with the pulse width of signal being sent to transistors and keep an eye on total power to identify the ideal operating point where maximum power is harvested. The mechanism of this ‘play around’ varies depending on the MPPT algorithm. For starters, a controller would start with a high/low pulse width and keep changing it to see at what load maximum power can be obtained from the panel. Normally good converters keep ‘perturbing’ the pulse width back and forth slightly to see if the maximum power point may have drifted and as a result can always keep harvesting maximum power irrespective of the time of day/external conditions).
Now lets come to the second part of your question, if the downstream load(e.g a battery) no longer needs power, how can the MPPT converter still continue to harvest maximum power. Short answer: It cant. If the maximum power that can be harvested is 100w while the battery/load needs no more than 50w, then simply put, the converter can no longer track the power point. I mentioned earlier that the MPPT converter keeps an eye on input voltage and current, it keeps an eye on the output bus voltage aswell. If the output voltage rises beyond maximum allowed bus voltage, the controllers software prevents it from trying to increase input load any further. The output bus voltage essentially overrides the MPPT algorithm’s wishes and your panel is just producing less energy then it could.
Lets come to the last part, if your converter is harvesting less power from the panel. Where does the remaining power go, the answer is: it doesnt even get produced. When a solar panel is just lying in the sun with no load connected to it, the panel’s cells create a voltage and wait for someone to apply a load, if there isnt enough load, no actual power generation happens and no additional heating should be produced(other then unnoticable effects from leakage currents).
Hope this helps.