One thing I’m struggling to understand is the voltage level at pins A
and B. Are these voltages referenced to the supply ground, or is there
another reference point/?
The A/B voltage levels are usually referenced to the ground pin on the IC. For an isolated RS485 chip it would be referenced to the ground pin on the same side as the A/B pins.
Additionally, would there be a short circuit if pin A were
accidentally connected to ground?
Whether there will be a short circuit sort of depends on exactly which chip you are using. Some like the SN65HVD17xx are designed to survive shorts directly to power (up to +70V) or ground. In the case of the SN65HVD17xx the datasheet specifies that the chip has circuitry to limit the current in any shorts to 250mA.
Some chips have no such protection and shorting to power or ground will burn up the chip and the current will only be limited by the resistances of the transistors at the output stage (usually only a few ohms).
How are the voltages at these pins generated?
That question is not answerable since each chip can choose its own implementation as long as they meet the RS485 specification with respect to voltage levels, drive strength, impedance, and timing.
Usually there will be some transistors at the output stage on the A/B pins. One to drive the pin high and another to drive it low, plus possibly some circuitry for slew rate limiting or fault protection.