The Fundamental Theorem of Finitely Generated Abelian groups is like the Fundamental Theorem of Arithmetic: it describes a "canonical way" of expressing a finitely generated abelian group as a direct sum (in fact, two different ways), in a way that is "essentially unique", and where two groups are isomorphic if and only if they have the same "canonical way of being described."
The analogy with the Fundamental Theorem of Arithmetic is that the latter tells you that there is a unique way (up to order) of expressing a positive integer as a product of powers of distinct primes; it does not tell you that there is only one way of expressing a positive integer as a product. So, the fact that we can write $36$ as $6\times 6$, with neither factor a prime power, does not contradict the Fundamental Theorem of Arithmetic. The Fundamental Theorem of Arithmetic is reflected in the fact that we can write $36$ as a product of powers of distinct primes (namely $2^2\times 3^2$) and that this is the only way to express $36$ as a product of powers of distinct primes (up to order). But it says nothing about other ways of expressing $36$ as a product. You can also use the Fundamental Theorem of Arithmetic to say that every positive integer can be written as $n=q_1q_2\cdots q_m$, where $q_1\leq q_2\leq\cdots\leq q_m$ are all primes, and this expression is unique in that if $n=p_1p_2\cdots p_n$ with $p_1\leq p_2\leq\cdots\leq p_n$ primes, then $m=n$ and $p_i=q_i$ for each $i$. Even though you have two different expressions, each one is "unique within its domain".
The Fundamental Theorem for Finitely Generated Abelian groups says that you have two different "canonical decompositions": one into cyclic groups of prime power order, and one into numbers that divide each other:
Every finitely generated abelian group $G$ can be written as $G\cong \mathbb{Z}^r \oplus \mathbb{Z}_{p_1^{a_1}}\oplus\cdots\oplus \mathbb{Z}_{p_k^{a_k}}$ where $r,k$ are nonnegative integers, $p_1,\ldots,p_k$ are primes, and $a_1,\ldots,a_k$ are positive integers. Moreover, this expression is unique in the sense that if $G\cong\mathbb{Z}^s\oplus\mathbb{Z}_{q_1^{b_1}}\oplus\cdots\oplus \mathbb{Z}_{q_{\ell}^{b_{\ell}}}$ with $s,\ell$ nonnegative integers, $q_1,\ldots,q_{\ell}$ primes, and $b_1,\ldots,b_k$ positive integers, then $r=s$, $k=\ell$, and there is a permutation $\sigma$ of $\{1,\ldots,k\}$ such that $p_i=q_{\sigma(i)}$ and $a_i=b_{\sigma(i)}$ for all $i$.
Every finitely generated abelian group $G$ can be written as $G\cong \mathbb{Z}^r\oplus\mathbb{Z}_{n_1}\oplus\cdots\oplus\mathbb{Z}_{n_t}$ where $r,t$ are nonnegative integers, $n_1,\ldots,n_t$ are positive integers greater than $1$, and $n_t|n_{t-1}|\cdots|n_1$; moreover, the expression is unique in the sense that if $G$ can also be written as $G\cong \mathbb{Z}^s\oplus\mathbb{Z}_{m_1}\oplus\cdots\oplus \mathbb{Z}_{m_u}$ where $s,u$ are nonnegative integers, $m_1,\ldots,m_u$ are positive integers greater than $1$, and $m_u|m_{u-1}|\cdots|m_1$, then $r=s$, $t=u$, and $m_i=n_i$ for each $i$.
For $\mathbb{Z}_6$, the first format of the decomposition says that we can write it as $\mathbb{Z}_2\oplus\mathbb{Z}_3$, and that this is the only way to write it as a direct sum of cyclic groups of prime power order (except for the trivial $\mathbb{Z}_3\oplus\mathbb{Z}_2$, which is really "the same way"). The second part says that we can also write it as $\mathbb{Z}_6$, and that this is the only way to write it as a direct sum of cyclic groups in such a way that the order of each one divides the order of the previous one. That is, we have two different "unique factorizations", depending on which format you want to use.