What a beautiful problem! The winning positions (for Bob, the player who just moved) are those where the stacksstack sizes are within a factor of the golden ratio $\phi$, i.e. the $(a,b)$$(p,q)$ with $$1/\phi < b/a < \phi.$$$$1/\phi < q/p < \phi.$$ So, the winning strategy is to make the stacks as even as possible to keep this invariant true after your move.
Say that $a\leq b$$p\leq q$. The legal moves result in positions of the form $(a,x)$$(p,q')$. This is in the band of winning positions whenever $x \in (a/\phi,a \phi)$$q' \in (p/\phi,p \phi)$ an interval whose length is exactly $a$$p$.
Since the possible $x$'s$q'$ are spaced $a$$p$ apart, exactly one such $x$$q'$ lies in the band. Then, $(a,x)$$(p,q')$ is a winning move unless it is $(a,b)$$(p,q)$ itself in the band, since we must have $x<b$$q'<q$. We've shown that there's a move to a winning position exactly when we're not a winning position, which inductively proves that these are the winning positions.
I found this solution by writing code to find the winning positions, and noticing the band pattern and suspecting the golden ratio.