Marco has an excellent and thorough article on the differences between both models:
The 5K Retina iMac is out, and it looks incredible so far on paper — so incredible that I’m seriously considering selling my new Mac Pro to get the Retina iMac instead. In fact, the case for the Mac Pro for anyone but advanced video editors, 3D modelers, and heavy OpenCL users is now weaker than ever.
I’ve always found the iMac to be a near perfect computer but now it’s getting ridiculous. Even the completely redesigned Mac Pro compares poorly, particularly considering it won’t be getting an external Retina display anytime soon:
It may be possible to use two Thunderbolt 2 cables to power a 5K display, but only if the GPU could treat each port as its own full-bandwidth DisplayPort 1.2 channel, the sum of which represented one logical display, and had the panel using something like MST to combine the two at the other end. But the only Mac with more than one Thunderbolt bus (not port) is the current Mac Pro, and I can’t see today’s Apple shipping an external display that none of their laptops can use.
If you’re in the market for a high-end desktop computer, the Retina iMac looks like a no-brainer.