For example, consider the permutation $$ \pi=\left(\begin{matrix} 1&2&3&4&5\\ 4&3&2&5&1 \end{matrix}\right).$$ You can write it with two cycles as $$ \pi =(145)(23).$$
Now I want to write $\pi$ as a product of transpositions. I know one way to do that is $$ \pi =(14)(45)(23)$$ because $(145)=(14)(45) $. However, I don't understand the logic behind this notation. Transpositions are cycles as well, so wouldn't that notation imply $\pi(1)=4 $, and $\pi(4)=1\ne 5$ (according to the first transposition)? Or $\pi(4)=5 $ and $\pi(5)=4\ne 1$ (according to the second transposition)? So could someone elaborate this notation to me? I guess that I have misunderstood the cycle notation.
Multiplication of cycles can be written as composition of permutations (order right to left). This way we can see the commonality when representing $\pi$ as multiplication of transpositions as well as multiplication of other cycles.