Apple offers four 21.5” A1418 systems! Three of which have 4K display and one that carries over the older display.
So lets look at the low end model: iMac 21.5" 2.3 GHz i5 (Mid-2017) Here we can see the max this system can support is 16 GB.
Now lets look at the next one up which has a 4K display: iMac 21.5" 3.0 GHz i5, 4K, (Mid-2017). And the next one: iMac 21.5" 3.4 GHz i5, 4K (Mid-2017) Both of which support 32 GB of RAM.
So why is this the case? It turns out the low end is using the same logic board of the older Late 2015 models with just an upgraded CPU which is why its RAM is limited. The newer 4K models have a very different logic board as these model use a newer CPU socket and PCH logic which is why these support the higher RAM!
Now if you are planing on upgrading the RAM on your own. Be very careful taking the display off as you can damage it quite easily it you don’t use the proper tools and techniques as outlined in the IFIXIT guides.