Its completely different: on a 21.5" you have to follow DIY instructions on somewhere like iFixit: cut the double-sided adhesive holding the screen on and partly disassemble the innards to get at the RAM slots, then you'll need a replacement set of adhesive tapes to put the screen back on. Not for the faint hearted - you might consider it to extend the life of an out-of-warranty iMac, but not on a brand-new one.
On the 27" 5k the RAM is
officially user-upgradeable -
you can find Apple's own instructions on their support site - just push a little button hidden by the power connector, a little door in the back of the case pops open and exposes just the RAM sockets and a little lever to release them. On an 8GB iMac there are two empty sockets - sweet spot is probably to get the 8GB model and add 2x8GB sticks to get 24GB. Crucial.com have a tool that points you to the correct RAM, and its the same Micron RAM that Apple use. You get a 24GB Mac for less than Apple's price for a 16GB one.
Only gotcha is that Crucial recommend a different, slightly slower RAM for the base i5 iMac 5k, as opposed to the faster i5 and i7 models - but their guide tool will tell you that.
Don't know why people are getting bogged down with "super-mega-X-ultra with go-faster stripes and fancy heatsink designed to look good in your illuminated plexiglass PC gaming rig and impress you friends by running Crysis at 150fps to their pathetic 149fps RAM"...