Obviously software can't directly act on the real world. A PLC discrete output uses an internal software "relay" to operate the output hardware that is connected to the terminals. This discrete output hardware connects the load to a voltage source and physically turns on the load. The discrete output hardware may be an actual relay, a transistor, or a triac.
Mayhap, you would like to read what goes on inside the PLC device. It will cover some things related to what you are asking.:nodi:
But my answer is: a PLC output always connects to hardware devices, no matter it be relays, terminals, display devices..etc. But before the signals goes to the physical output, it is being processed inside its brain, the CPU. In there, are lots of "software" relays and output coils are makes up the its basic functions. Just like how a human brain works...nerves sends signals to the brain, and the brain processes the signals with the help of nurons (can't remember the spelling), i.e the internal relays and memory coils; and then to the physical output, which is your reaction (output) to what you had experienced (input).