Coming from an electronics engineering background, I can tell you most assuredly that the heat generated inside the current iMac design enclosure is not good for the electronic components over a period of time.
There are a lot of posts here of hard drive failure, CPU, GPU and even logic board failures.
I am convinced that all are heat related issues.
Heat is the enemy of all small electronic components, period!
Component failure and component "brown-outs" can be caused both by fluctuating electric current and/or heat!
Electronic components like to operate in as cool a temperature as possible. Conputer components, at one time were cooled by either water, anti-freeze-like fluids, liquid Nitrogen, etc.
In earlier iMac models, heat was vented by having a case with that has ample venting built-into the case design.
The new iMac designs IMO, do not have enough sufficient, passive venting to vent all of the heat the iMac components generate. I feel the aluminum body conducts as much heat on the inside of the enclosure as it convects outward from the enclosure with an insufficient net reduction in overall internal temperatures.
Apple has definitely NOT done long duration stress testing of its current designs.
It refreshes its product designs every couple of years or so. So why do long-term testing on a design that will be redesigned and refreshed every few years. I believe they do not.
Apple engineers were simply concerned much more with the complete quiet operation of the iMac design than with internal heat buildup issues within the current iMac enclosure designs.
I and many other users use a software fan control to ramp up the iMac's internal fans as well as use an external fan on the backs of our iMacs to further cool them down more directly.
The result is an additonal 15% to 20% reduction in the iMacs overall running temps.
As to your main question, when running OS X applications, OS X is doing things, while the apps you are also running are doing things. These things use CPU, GPU cycles, swapping commands and data in/out of RAM, maybe using hard drive cycles, etc. These processes work different hardware and software components of your iMac and, in turn, increase the components temperatures. Typically the CPU, GPU and hard drive ( and in the case of getting data on and off of discs, the optical drive) do heat up appreciably and heat up even more when the application tasks get more and more demanding of the Mac hardware.