Ok, I'm gonna try to explain it as I understand it, anybody correct me if I'm wrong...
DAC: Digital-Analog Converter. Is the responsible of transforming your digital signal to analog signal and this way allowing you to listen to it through your headphones. The quality of the transformation may be good or bad, depending on the implementation of the DAC itself. Each DAC has its own technical characteristics and resolutions. The DAC is gonna be the first bottleneck between your files and the final sound, therefore if you have a very high quality file but your DAC is not capable enough, you will never get the quality of the original file on your headphones.
Amplifier: Initially it only serves two purposes: 1. Amplify the signal to make it louder. 2. Properly feed the later load (your headphones). There are difficult and easy to drive headphones, and it's something that depends of the frequency you are reproducing. Let's say that the prebuilt amplifier of your phone might be able to drive properly between 3k and 7kHz but it's not able to drive properly in the sub 400Hz region, therefore your music is gonna sound weird and muddy. The better the amplifier the better the sound usually.
Initially both the amplifier and the DAC should be completely transparent, that means that they should not boost any frequency nor modify their responses (that is what an objective DAC, amp does). In the reality the world is far from being perfect, which means that you are gonna be altering the signal by passing it through several steps. That's why everybody talks about warm or bright DAC's / amps, and even more, some people try to find some sinergy between their headphones and gears (this is something that depends on you, and on what you give the highest emphasis in your equipment).
All of this being said, you might not experience an improvement by buying a better amp if your IEMs are already properly driven (amp section). Regarding the DAC section it will depend of your current source. Let's say that the amp should only increase the volume or the way your IEMs are driven, but if your DAC is providing a ****ty sound, your amp is not going to improve that.
Hope this helps.