That's very simple, actually
A soundcard analog output is approximately a voltage source, a resistor and (sometimes) a capacitor in series.
If the capacitor is too small, it will reduce bass. If it's big enough (or not present at all) it can be ignored. We will ignore it from now.
The voltage source is limited to some voltage, say V. It's power supply may be limited to some current I and/or power P.
The resistor has some resistance called Zout (output impedance, but it's basically pure resistance).
Every headphone has some impedance, say Z. The exact impedance is frequency-dependent and in some/many cans it's higher around 100Hz (see
here for examples).
By Ohm's law, the output will produce V/(Zout+Z) of current, yielding V²/(Zout+Z) power. Since headphone and output impedance form a voltage divider, headphone will receive Z/(Zout+Z) of this power, i.e. Z*V²/(Zout+Z)².
From this and the "SPL at 1mW of input" spec you can derive approximate loudness.
Practical things to note:
- low Zout is desired because it minimizes Z-dependent variations in headphone power
- IEMs have large Z-variations across audible frequency range and hence sound bad from high Zout outputs
- power used by the headphone is maximized when Z equals Zout, not when Z is as low as possible - a common misconception here
- current,power produced cannot exceed I,P or clipping will occur, not some mysterious "not enough juice" - another misconception
- forget about getting these specs from soundcard manufacturers, except for pro gear
- you can find instructions on measuring most of this stuff using a multimeter and few audio cables