In mathematics, certain unequal objects may be identified. For example, the set of real numbers $\mathbb{R}$ can be identified with the subset $\mathbb{R}\times \{0\}=\{(x,0):x\in\mathbb{R}\}$ of the plane $\mathbb{R}^2$. Similarly, the set of real numbers $\mathbb{R}$ can be identified with the subset $\{0\}\times \mathbb{R}=\{(0,y):y\in\mathbb{R}\}$ of the plane $\mathbb{R}^2$.
Let me explain in more detail what this identification actually means. If you visualize the plane $\mathbb{R}^2$, then you may visualize the set of real numbers $\mathbb{R}$ as being the $x$-axis in the plane. However, this is not logically correct since the $x$-axis in the plane is more properly the set $\{(x,0):x\in\mathbb{R}\}$ and the set of real numbers is the set $\mathbb{R}$. Note that these two sets are not equal but can be identified. The idenfitication is in this case, as it usually is, a bijection between the sets in question. The most natural bijection is the map $f:\mathbb{R}\to \{(x,0):x\in\mathbb{R}\}$ defined by the rule $f(t)=(t,0)$.
Similarly, we can naturally identify the set $\mathbb{R}$ with the set $\{(0,y):y\in\mathbb{R}\}$ by the bijection $g:\mathbb{R}\to \{(0,y):y\in\mathbb{R}\}$ defined by the rule $g(t)=(0,t)$.
In fact, these identifications are relevant to your question. In essence, an element of the plane $\mathbb{R}^2$ (or a vector, if you prefer) is an ordered pair $(x,y)$ where $x,y\in\mathbb{R}$. We can write (using vector addition, if you prefer) $(x,y)=(x,0)+(0,y)$. Note that this sum is not a sum of real numbers since neither $(x,0)$ nor $(0,y)$ is a real number; rather, they are ordered pairs whose coordinates are real numbers. Nonetheless, we can identify them with real numbers using the bijections $f$ and $g$ above. More precisely, $f(x)=(x,0)$ and $g(y)=(0,y)$.
Let us now return to your question. An element of $W=U\times V$ is an ordered pair $(u,v)$ where $u\in U$ and $v\in V$. We can write $(u,v)=(u,0)+(0,v)$. However, this sum is not a sum of a vector in $U$ and a vector in $V$. Nonetheless, for most purposes this is not necessary since we have identifications $f:U\to U\times \{0\}=\{(u,0):u\in U\}$ and $g:V\to \{0\}\times V=\{(0,v):v\in V\}$ defined by the rules $f(a)=(a,0)$ and $f(b)=(0,b)$ for $a\in U$ and $b\in V$. In fact, as you correctly observe, these identification maps are actually linear transformations.
The following exercises might be useful (and are relevant to the result you have noted):
Exercise 1: Let $A,B$ be vector spaces (over a field $\mathbb{F}$) and let $T:A\to B$ be an injective linear transformation (i.e., the kernel (or the null space, if you prefer) of $T$ is ${0}$). If $(v_1,\dots,v_n)$ is a linearly independent tuple of vectors in $A$, prove that $(T(v_1),\dots,T(v_n))$ is a linearly independent tuple of vectors in $B$.
Exercise 2: Let $W=U\times V$ where $U$ and $V$ are vector spaces. Let us recall the identification maps $f:U\to W$ and $g:V\to W$ defined above by the rules $f(u)=(u,0)$ and $g(v)=(0,v)$. Prove that $f$ and $g$ are injective linear transformations.
Exercise 3: If $(u_1,\dots,u_n)$ and $(v_1,\dots,v_m)$ are bases of $U$ and $V$, respectively, prove that $((u_1,0),\dots,(u_n,0))$ and $((0,v_1),\dots,(0,v_m))$ are linearly independent tuples in $W=U\times V$. (Hint: use Exercise 1 and Exercise 2.)
Exercise 4: Prove that if $f(u)+g(v)=0$ for $u\in U$ and $v\in V$, then $f(u)=g(v)=0$. (Of course, $0$ is the zero vector of $W$ in this case.)
Exercise 5: Finally, prove that the tuple $((u_1,0),\dots,(u_n,0),(0,v_1),\dots,(0,v_m))$ is linearly independent in $W=U\times V$ if $(u_1,\dots,u_n)$ and $(v_1,\dots,v_m)$ are bases of $U$ and $V$, respectively. (Hint: use Exercise 3 and Exercise 4.)
Warning: Solutions Below
Solution to Exercise 1: Let $(v_1,\dots,v_n)$ be a linearly independent tuple of vectors in $A$. We wish to prove that the tuple $(Tv_1,\dots,Tv_n)$ is linearly independent in $B$. Let us assume $c_1Tv_1+\cdots+c_nTv_n=0$ for some scalars $c_i\in \mathbb{F}$ ($1\leq i\leq n$); we wish to prove that $c_i=0$ for all $1\leq i\leq n$. We can use the linearity of $T$ and write $T(c_1v_1+\cdots+c_nv_n)=0$. Since $T$ is injective and since $T0=0$, it follows that $c_1v_1+\cdots+c_nv_n=0$. However, the tuple
$(v_1,\dots,v_n)$ is linearly independent in $A$ by assumption. Therefore, $c_i=0$ for all $1\leq i\leq n$ and the proof is complete since the scalars $c_i\in\mathbb{F}$ ($1\leq i\leq n$) were arbitrary.
Solution to Exercise 2: If $f(u_1)=f(u_2)$ for $u_1,u_2\in U$, then $(u_1,0)=(u_2,0)$; by the definition of equality in $W=U\times V$, it follows that $u_1=u_2$. Therefore, $f$ is injective; the proof that $g$ is injective is similar.
I hope this helps!