Partial answer - addressing the questions about managing the system for the ISS
tl;dr it's done manually by the ground
If the Primary Power System batteries are not discharged, they can
overcharge, thereby causing damage to the batteries. Or, they can
develop a memory, meaning the full depth of discharge (i.e., time that
a rechargeable battery can last on a single discharge) would not be
available. Ground controllers must actively manage battery states of
charge during high beta operations by reducing the current used to
charge batteries and occasionally deactivating batteries to prevent
them from overcharging. As a result, some of the power that is
generated is wasted and cannot be used by the EPS. Annually, batteries
must be reconditioned by taking each battery off-line and completely
discharging it to remove any memory buildup and allowing the state of
charge (SOC) software calculations to be updated
From a planning perspective, the operations team plans for the
batteries to fully recharge each orbit and is limited to a maximum
discharge down to 65% SOC to prevent excessive wear on the battery
hardware and maintain contingency reserve power in case of a failure
preventing a battery from recharging.
All these operations are carefully defined in the flight rules, which detail under what conditions the batteries can be discharged below the nominal limits.
From The International Space Station Operating an Outpost in the New Frontier page 161
Note: NASA does not make the ISS Flight Rules publicly available.