An iMac is a consumer computer. Having one sound output port is normal for a consumer computer. A Mac Pro, on the other hand, has a headphones jack in front, another in back, plus an audio optical digital output port.
However, you can add another audio output mini-jack using this $30 USB device, called an iMic by Griffin Tech.
http://www.griffintechnology.com/products/imic/
When connected, it becomes available as a another choice in System Preferences
Sound pane
Output tab, and you can switch the output there.
There are other USB-based audio devices, including speakers that connect directly to USB (and get digital audio) instead of to the analog mini-jack.
A more simple solution is to get a splitter made for iPod users, to make one output jack into two. Connect both at once. To use the external speakers, turn them ON. The headphones will still be connected, but that is fine (you can't hear them). To use the headphone, put on the headphones and turn the external speakers OFF.