  Performing a faithful transfer of an unknown quantum state is a key challenge
for enabling quantum networks. The realization of networks with a small number
of quantum links is now actively pursued, which calls for an assessment of
different state transfer methods to guide future design decisions. Here, we
theoretically investigate quantum state transfer between two distant qubits,
each in a cavity, connected by a waveguide, e.g., an optical fiber. We evaluate
the achievable success probabilities of state transfer for two different
protocols: standard wave packet shaping and adiabatic passage. The main loss
sources are transmission losses in the waveguide and absorption losses in the
cavities. While special cases studied in the literature indicate that adiabatic
passages may be beneficial in this context, it remained an open question under
which conditions this is the case and whether their use will be advantageous in
practice. We answer these questions by providing a full analysis, showing that
state transfer by adiabatic passage -- in contrast to wave packet shaping --
can mitigate the effects of undesired cavity losses, far beyond the regime of
coupling to a single waveguide mode and the regime of lossless waveguides, as
was proposed so far. Furthermore, we show that the photon arrival probability
is in fact bounded in a trade-off between losses due to non-adiabaticity and
due to coupling to off-resonant waveguide modes. We clarify that neither
protocol can avoid transmission losses and discuss how the cavity parameters
should be chosen to achieve an optimal state transfer.
