Given a vector $p$, to rotate it by a quaternion $q$, we use the formula:
$$p' = q p \hat{q}$$
where $\hat{q}$ is the conjugate of $q$. But if we use rotational matrices, then it's just
$$p' = Rp$$
While it's clear why the matrices work this way, I just cannot develop any intuition on quaternion rotation formula. I realise the formula does work, but still my guts feel as if it was “rotate $p$ by $q$ and then compose it with the inverse rotation of $q$”. Maybe there is some simple explanation?
Lets try to develop the formula:
$$p' = q p \hat{q} = \left(\begin{array}{cc} \vec{p'} \\ 0\end{array} \right) = \left(\begin{array}{cc} \vec{u}\sin{\phi\over2} \\ \cos{\phi\over2}\end{array} \right) \otimes \left(\begin{array}{cc} \vec{p} \\ 0\end{array} \right) \otimes \left(\begin{array}{cc}- \vec{u}\sin{\phi\over2} \\ \cos{\phi\over2}\end{array} \right) $$
In which $\vec{u}$ and $\phi$ are the axis and angle of the rotation represented by the quaternion. After various transformation that I will omit for sake of brevity you obtain
$$ \vec{p'} = \vec{p}_\perp \cos{\phi} + \left( \vec{u}\times \vec{p}\right)\sin{\phi} + \vec{p_\parallel}$$
That is the 3D vector rotation formula. Moreover, considering both $$p' = q p \hat{q}$$ $$p' = Rp$$
You can derive the result:
$$\left(\hat{q}\right)^\oplus \left(q\right)^+ = \left(\begin{array}{cc}R & 0\\ 0 & 1\end{array}\right)$$
where R is the rotation you were referring to.