You asked for "intuition". One way of looking at it is this.
An $m \times n$ matrix $A$ operates on $n$-dimensional vectors, taking them to $m$-dimensional vectors. The rank $r_A$ of $A$ is the dimension of the range of $A$,
and is also $n$ minus the dimension of the kernel of $A$. That is, you start with $n$ linearly independent vectors $v_j$ spanning ${\mathbb R}^n$; the images $A v_j$ of them under $A$ are not linearly independent, because there are $k$ independent relations between them corresponding to the dimension of the kernel of $A$, so we have only $r_A = n - k$ linearly independent vectors spanning the range of $A$. Now in $BA$, $B$ operates on these vectors so the rank of $BA$ is the number of linearly independent vectors in the range of $BA$. This is reduced from $r_A$, not by the dimension of the kernel of $B$, but by the dimension of the intersection of the kernel of $B$ with the range of $A$. That is, $\text{rank}(BA) = \text{rank}(A) - \dim(\ker (B) \cap \text{range}(A))$. Similarly ($B$ being $n \times m$ so that $AB$ and $BA$ both make sense) $\text{rank}(AB) =
\text{rank}(B) - \dim(\ker(A) \cap \text{range}(B))$. And there is no reason for these to be the same.
Indeed, given $n$ and the ranks of $A$ and $B$, $\ker(A)$ and $\text{range}(B)$ can be any subspaces of ${\mathbb R}^n$ of dimensions $n - \text{rank}(A)$ and $\text{rank}(B)$ respectively, and their intersection can have any dimension from $\max(\text{rank}(B) - \text{rank(A)},0)$ to $\min(n - \text{rank}(A),\text{rank}(B))$.
For example, if $m=n = 5$ and $\text{rank}(A) = \text{rank}(B) = 3$, $\dim(\ker(A) \cap \text{range}(B)$ can have any dimension from 0 to 2, making $\text{rank}(AB)$ anything from 1 to 3, and similarly $\text{rank}(BA)$ can be anything from 1 to 3. To get an example with $\text{rank}(AB) = 3$ and $\text{rank}(BA) = 1$, you want $\ker(A)$ and $\text{range}(B)$ to be subspaces of ${\mathbb R}^5$ of dimensions 2 and 3 respectively with intersection of dimension 0, while $\ker(B)$ and $\text{range}(A)$ are subspaces of
dimensions 2 and 3 with intersection of dimension 2. If $e_1$ to $e_5$ are the standard basis vectors of ${\mathbb R}^5$, you could for example have $\ker(A) = \text{span}(e_1,e_2)$
while $\ker(B) = \text{span}(e_4,e_5)$ with $\text{range}(A) = \text{range}(B) = \text{span}(e_3, e_4, e_5)$. Thus we could have
$$ A= \left[ \begin {array}{ccccc} 0&0&0&0&0\\ 0&0&0&0&0
\\ 0&0&1&0&0\\ 0&0&0&1&0
\\ 0&0&0&0&1\end {array} \right], \ B = \left[ \begin {array}{ccccc} 0&0&0&0&0\\ 0&0&0&0&0\\ 1&0&0&0&0\\ 0&1&0&0&0
\\ 0&0&1&0&0\end {array} \right] $$