It all boils down to the elementary divisors of your matrix, because two matrices are similar if and only if they have the same elementary divisors. In other words, similarity transformations always preserve elementary divisors.
Suppose your matrix $A$ has rank $r$ and let $D_k(x)$ be the g.c.d. of all $k \times k$ minors of $x I - A$, for $k=1,\ldots,n$. The invariant polynomials of $A$ are given by
$$i_k(x) = \frac{D_{n-k+1}(x)}{D_{n-k}(x)},$$
for $k=1,\ldots,n-1$, with $i_n(x) = 1$. It can be checked from Laplace's formula for the determinant that $D_{n-k}(x)$ indeed divides $D_{n-k+1}(x)$. In particular, $D_{n}(x)$ is the characteristic polynomial of $A$, $f(x)$. So, the product of the invariant polynomials gives $f(x)$.
Now, each invariant polynomial is of the form
$i_k(x) = (\phi_1(x))^{m_{k,1}} \dots (\phi_r(x))^{m_{k,r}}$,
where the factors $(\phi_j(x))^{m_{k,j}}$ are the elementary divisors of $A$. So, the characteristic polynomial is ultimately given by the products of these elementary divisors.
The elementary divisors are powers of polynomials which are irreducible in the field that you're considering. So, if the roots of $\phi_j(x)$ belong to that field, then it can be written in the form $\phi_j(x) = c(x - \lambda_j)$ where $c$ is a constant. Note that $\lambda_j$ is an eigenvalue of $\lambda_j$. If your matrix has an elementary divisor $(\phi_j(x))^m$, then its canonical form has a Jordan block of order $m_{k,j}$ associated with the (real) eigenvalue $\lambda_j$. You can easily check that the only elementary divisor of such a block is indeed $(x - \lambda_j)^m$ (note that the minor of order $m$ associated with the $(m,1)$th element of that block is $\pm 1$, and so it has a single elementary divisor which equals its characteristic polynomial $(x - \lambda_j)^m$.
However, if you're working on a field which is not algebraically closed, such as $\mathbb{R}$, the elementary divisors cannot always be written like that. In $\mathbb{R}$, irreducible polynomials are either of the form above or are second-degree polynomials with complex conjugate roots (i.e., with a negative discriminant). If $\phi_l(x)$ happens to be an irreducible second-degree polynomial, then an elementary divisor of the form $(\phi_l(x))^q$ "appears" in the canonical form of $A$ as a block of the block-diagonal form you have shown, containing the rotation matrix $R_\varphi$ in its diagonal. Indeed, you can check that the only elementary divisor of such a block is $[(x - \rho\cos \varphi)^2 + \rho^2\sin^2 \varphi]^q$, which has a root $\rho(\cos \varphi + i \sin \varphi) = \rho e^{i \varphi}$ with multiplicity $q$ and another root $\rho(\cos \varphi - i \sin \varphi) = \rho e^{-i \varphi}$ also with multiplicity $q$ (this requires a bit more of work than the previous case, but is not hard - try it in a $4 \times 4$ case). Note that any complex number can be written in the form $\rho e^{i \varphi}$. So, if you matrix has complex eigenvalues, these are "accounted for" in its canonical form by a block of the kind your book has mentioned.
I suggest you take a look at the book "The Theory of Matrices" (vol. 1) by Gantmacher, where everything I mentioned is explained in detail.