Three Cases. Given 3D unit vectors $\bf a$ and $\bf b$, the rotations which send ${\bf a}\mapsto{\bf b}$ are described in $3$ cases. The first $2$ are trivial. I'll borrow a physics term for the $2$nd.
- parallel vectors (${\bf a}={\bf b}$):$~~$ any angle around the axis ${\bf a}$
- antiparallel vectors (${\bf b}=-{\bf a}$):$~~$ any $180^\circ$ angle around any axis perpendicular to ${\bf a}$
- generic vectors (${\bf a}\ne\pm{\bf b}$):$~~$ any axis in the span of ${\bf a}$, ${\bf b}$'s normal ${\bf n}$ and midpoint ${\bf m}$, by the appropriate angle; for axes ${\bf n}$ and ${\bf m}$ specifically, angles $\angle{\bf ab}$ and $180^\circ$ respectively.
Two Extremes. Let's look at the generic case's most salient examples in more detail.
- quaternion $q_1={\bf m}$: Rotation around the midpoint ${\bf m}=\frac{{\bf a}+{\bf b}}{\|{\bf a}+{\bf b}\|}$ by $180^\circ$.
- quaternion $q_2=\exp(\frac{\theta}{2}{\bf n})$: Rotation by the convex angle $\theta=\angle{\bf ab}$ around the axis ${\bf n}$, positively-directed from ${\bf a}$ to ${\bf b}$ in their oriented span with unit normal ${\bf n}=\frac{{\bf a}\times{\bf b}}{\|{\bf a}\times{\bf b}\|}$.
Note $q_1$ has the polar form $q_1=\exp(\frac{\pi}{2}{\bf m})$, which is just $\bf m$. Since $1,{\bf m},{\bf n}$ are orthogonal in $\Bbb H$, we can say $q_1,q_2$ are orthogonal in $\Bbb H$ too.
Minimal Rotation. The unique rotation around ${\bf n}$ corresponds to the antipodal pair of quaternions $\pm\exp(\frac{\theta}{2}{\bf n})$. From the "spinorial" perspective, $-q_2$ rotates around $-{\bf n}$ by $-\theta$, or equivalently around $\bf n$ by the reflex angle $2\pi-\theta$. We can rewrite $q_2$ in terms of $\bf a$, $\bf b$ via Euler's Formula, half-angle formulas, and dot product formula:
$$ \begin{array}{ccl}
q_2 & = & \exp\bigl(\frac{\theta}{2}{\bf n}\bigr) ~=~ \cos\bigl(\frac{\theta}{2}\bigr)+\sin\bigl(\frac{\theta}{2}\bigr)\,{\bf n} \\[3pt]
& = & \sqrt{\frac{1+\cos\theta}{2}}+\sqrt{\frac{1-\cos\theta}{2}}\,{\bf n} \\[3pt]
& = & \sqrt{\frac{1+{\bf a}\cdot{\bf b}}{2}}+\sqrt{\frac{1-{\bf a}\cdot{\bf b}}{2}}\frac{{\bf a}\times{\bf b}}{\|{\bf a}\times{\bf b}\|}.
\end{array} $$
Often $q_2$ is the rotation chosen to map ${\bf a}\mapsto{\bf b}$ since it has the smallest angle. (Presumably there are computational and graphical reasons as well, but I'm not a programmer.)
All Rotations. What about the set ${\cal T}({\bf a},{\bf b})$ of all rotations which map ${\bf a}\mapsto{\bf b}$? It corresponds to a circle of unit vectors in $\Bbb H$ which lie in a 2D subspace $\cal S$. Rewrite $q{\bf a}q^{-1}={\bf b}$ as $q{\bf a}={\bf b}q$ so as to allow non-unit quaternions. Thus, the solution space $\cal S$ is (in linear algebra terms) the kernel of the linear operator $q\mapsto q{\bf a}-{\bf b}q$. It is not too hard to verify the image of $q=1$ and $q={\bf a}$ under this linear operator are linearly independent in $\Bbb H$, so the image has dimension at least $2$, and thus the kernel has dimension at most $2$. We know $q_1={\bf m}$, $q_2=\exp(\frac{\theta}{2}{\bf n})$ are in the kernel, so every other solution is a linear combination of $q_1$ and $q_2$.
So, ${\cal T}({\bf a},{\bf b})$ is the unit circle in ${\cal S}={\rm span}\{q_1,q_2\}\subset\Bbb H$, i.e. every rotation which sends ${\bf a}\mapsto{\bf b}$ is a normalized linear combination of $q_1$ and $q_2$.
Visualization. Every rotation is part of a "one-parameter subgroup," which in 3D basically means all rotations around a given axis. The arc swept from $\bf a$ to $\bf b$ under such rotations is part of a circle on the sphere $S^2$. For $q_1$, this circle has minimum spherical radius $\frac{\theta}{2}$ and center $\bf m$. For $q_2$ it has maximum spherical radius $\frac{\pi}{2}$ (the unique great circle thru $\bf a$ and $\bf b$) and center $\bf n$.
As we let the rotation vary, we get different circles. This results in a foliation of the sphere, consisting of all circles thru $\bf a$ and $\bf b$. It is the spherical analogue of the pencil of Apollonian circles in the plane $-$ in fact they are related by stereographic projection. (On the Riemann sphere, these are flowlines of hyperbolic Mobius transformations with fixed points $\bf a$, $\bf b$.) The set of all the circles' centers is the perpendicular bisector of the arc from $\bf a$ to $\bf b$.
Transporters. In the language of group actions, if $G$ acts on $\Omega$ and $a,b\in\Omega$ then the set $T(a,b)=\{g\in G\mid ga=b\}$ of all group elements sending $a\mapsto b$ is called the transporter. It is a left and right coset $T(a,b)=g\,{\rm Stab}(a)={\rm Stab}(b)g$ for any representative $g\in T(a,b)$.
For us, $G={\rm SO}(3)$ and $\Omega=S^2$, then ${\rm Stab}({\bf a})$ and ${\rm Stab}({\bf b})$ are the unit circles of $\Bbb R[{\bf a}]$ and $\Bbb R[{\bf b}]$ respectively (both of these 2D subalgebras are $\cong\Bbb C$ by corresponding $\bf a$ or $\bf b$ to $\bf i$). What the coset equation says, then, is that any rotation sending ${\bf a}\mapsto{\bf b}$ can be precomposed with a rotation around $\bf a$ or postcomposed with a rotation around $\bf b$ and the result is still a rotation which sends ${\bf a}\mapsto{\bf b}$ (one of Thomas Andrews' comments under the OP).
Quaternions. For me, the quaternions are a 4D algebra $\Bbb H=\Bbb R\oplus\Bbb R^3$ and every quaternion is uniquely expressible as a sum of a scalar and a 3D vector. The product of vectors satisfies the "geometric product" formula ${\bf uv}=-{\bf u}\cdot{\bf v}+{\bf u}\times{\bf v}$, and thus the product of quaternions can be FOILed. Sqrts of $+1$ are $\pm1$, sqrts of $-1$ are unit vectors of $S^2\subset\Bbb R^3$, quaternions commute iff they have parallel vector parts, and anticommute iff are orthogonal vectors. It has orthonormal basis $\{1,{\bf i},{\bf j},{\bf k}\}$ with inner product $\langle p,q\rangle={\rm Re}(\overline{p}q)$ (where real part means same as scalar part, and $\overline{p}$ is the quaternion conjugate).
$\bigl[$ While $\Bbb H$ is generated by ${\bf i},{\bf j}$ and thus is the geometric algebra ${\cal G}(0,2)$ (aka Clifford algebra), its 3D symmetry indicates it's better (in the geometric algebra context) to think of it as the even subalgebra of either of ${\cal G}(3,0)$ or ${\cal G}(0,3)$. Symmetry is implicit in Hamilton's Broom Bridge equations ${\bf i}^2={\bf j}^2={\bf k}^2={\bf ijk}=-1$, and the cycle rule for multiplying ${\bf i},{\bf j},{\bf k}$, leading to the dot/cross product description I gave above with 3D symmetry. The vector algebra wars and history of quaternions, vectors (electromagnetism), and geometric algebra is fascinating, see M. Crowe's A History of Vector Analysis. $\bigr]$