I would like to how the system voltage whether the system must operate in 24V, 48V or 96V is determined in a solar panel system (let's consider that the solar panel system is a rooftop model)?
It is an engineering choice, based on technical but also economic considerations: reduce the electrical losses, investment, type of loads (if you have only receivers of 24 V to supply, it is better to select 24 V instead of 12 V, to avoid additional components), etc.
Generally, this is the recommended range, depending on the power, according to a colleague of mine: