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?