A battery such as this is able to provide multiple different voltages based on user input. Given that the textbook battery provides a fixed voltage, how is this achieved? Are there multiple cells which are connected up together differently depending on the requested voltage or does it work in a different way?
the power supply can be configured to furnish different voltages by changing the circuitry inside it under software control. There are several different ways to control the voltage output of a "programmable" power supply like this. the engineering stack exchange guys can describe them for you. programmable supplies can be run off either wall power or internal batteries.
In the dim, dark and distant days of electrical engineering, batteries with two or three different voltage outputs were commonly used in things like portable radios. In those batteries, the different voltages were achieved by packaging inside a single container different batteries, each with different number of cells in series, and running their outputs into a special plug connector with a different voltage available on each pin.