What determines the peak voltage levels for RS-232 lines? Is it determined by the software? The hardware? Something else?
The RS-232 standard specifies the range as:
0 (space) Asserted +3v to +15v 1 (mark) Deasserted −15v to −3v
In addition, inputs must tolerate voltages up to ±25v, and outputs must tolerate indefinite shorts to ground.
In the past, a lot of equipment used ±12v since it was available from a minicomputer power supply for example. Once personal computers became popular, most of them switched to ±5 since it is commonly available and still within the spec. (Well, the +5 is commonly available, additional circuitry is necessary to get the -5V if the main power supply does not provide it.)
As an example, the MAXIM series of UART RS-232 interface chips such as the MAX220-MAX249 series use a voltage doubler and voltage converter to generate ±10v.)
Specifically the voltage levels for mark and space are determined by the power supply rails of the transmitting circuit. The software neither knows nor cares what voltages represent mark or space (0 or 1). As long as the receiving circuit can discern the difference. In some cases it is not unusual to find simple TTL levels (0 and 5V) in modern digital equipment decades removed from the vintage technology.