Your first figure has a flaw.
It's lacking the input capacitors of the DC-DC converter.
Those are massively important.
Let's assume that the L is so big that the current is approximately constant, i.e. very little variation during the switching cycle.
Let's also assume that the duty cycle is 50%, i.e. the switch is open 50% of the time and closed 50% of the time.
Then you have half of the time no current in the solar panel and half of the time twice the average current in the solar panel. That's very far away from the maximum power point. Actually, in this case the controller trying to keep the solar panel at the maximum power point is not keeping it at this point. Without the input capacitors, this is simply a PWM controller.
If you add a huge input capacitor parallel to the solar panel, in this case the twice-the-average current would come half from the solar panel, half from the input capacitor. Then when the switch is opened, the input capacitor voltage has sagged, so the solar panel would still be charging the input capacitor, with the same current the solar panel previously supplied to the inductor. So the solar panel current with huge input capacitors would be constant, and it would be operating at the maximum power point.
A DC-DC converter can work without input capacitors, if (a) it's connected to a device that already has output capacitors, or (b) it's connected to a battery. Neither of these is true in this case. (And besides, input capacitors can help in cases (a) and (b) as well since the input capacitors are closer to the DC-DC converter high frequency part, with less wiring resistance.)
Your figure is a buck-boost converter. To understand how it can reduce or increase the voltage, you need some understanding in DC-DC switched mode power supplies. Essentially when the switch is closed, it will charge the inductor to a certain current. Then when the switch is opened, the only way for the inductor current to go is to charge the capacitor C, and an inductor will maintain whatever current was going through it, and create whatever voltage necessary to maintain this current. It may be the voltage of the inductor will be less or more than what it used to be. Since the derivative of the current switches sign, the voltage will be inverted, and its absolute magnitude can either increase or decrease depending on what voltage C has. The control algorithm just then varies the duty cycle to keep the capacitor C at the optimal voltage.
Most MPPT systems for battery charging are buck converters, so they require the solar panel to have a higher maximum power point voltage than the battery voltage, usually by a margin of few volts, but usually you want far more margin since you want maximal power transfer for cloudy days as well and in those days the maximum power point voltage reduces. The buck-boost converter can allow lower maximum power point voltage as well, because it can ramp up the voltage too. The cost of the buck-boost converter is that it requires a heftier inductor, since all of the energy needs to be stored in the inductor magnetic field. Another cost is that the voltage inverts its sign, so if you want negative side to be ground on both sides, you can't have that. There are some ICs that do synchronous rectification in a buck-boost configuration in a way that allows maintaining the voltage sign by controlling several MOSFETs.