I do not know how photon can, but here is how EM wave can:
Imagine charged particle oscillating here and there according to the function
$$
x(t) = x_0 \cos \omega t
$$.
If the EM wave is such that the electric field oscillates in the same direction according to
$$
E(t) = E_0 \cos (\omega t - \varphi),
$$
I do not know how photon can, but here is how EM wave can:
Imagine charged particle of charge ##q## oscillating here and there according to the function
$$
x(t) = x_0 \cos \omega t.
$$
If the EM wave is such that the electric field oscillates in the same direction according to
$$
E(t) = E_0 \cos (\omega t - \varphi),
$$
i.e. there is some phase shift ##\varphi##, the net power of the electric force is given by
$$
P(t) = E(t) \dot x(t)
$$
and can be positive or negative according to value of ##\varphi##. If the power is negative, it means that the oscillating particles returns energy into the field and thus will decrease its oscillations - hence "stimulated emission".
i.e. there is some phase shift ##\varphi##, the net power of the electric force is given by
$$
P(t) = qE(t) \dot x(t)
$$
and can be positive or negative according to value of ##\varphi##. If the power is negative, it means that the oscillating particles returns energy into the field and thus will decrease its oscillations - hence "stimulated emission".
Of course atom is more complicated, but the idea is the same - whether there is absorption or release of EM energy depends on the mutual phase of the system and the EM wave.