For example, a passive component such as a resistor can be used to control the current to the battery.
An active component, such as a transistor operating in a linear mode, can be used to control the charging current to the battery.