When you play any sounds out of your computer or phone or MP3 player, they are pure digital signals in the form of 0s and 1s. In order for headphones to listen to that signal, they need a device to convert it into an analog signal. This is a Digital-to-Analog Converter, or a DAC https://snaptube.cam/ 9apps.
A DAC by itself, however, won’t output the signal to be strong enough by itself. This is where the amplifier comes in. It amplifies the analog signal from the DAC to a level where it can be audible on the headphones.
All sound cards, for example, typically combine the DAC, amp, and recording parts all into a single unit. DAC standalone units have the DAC, but require an amp if they want to be used with headphones. Amp standalone units will only take a signal from a DAC or output from another amp and amplify it.