I know that the comments by @Did are informative. But, I thought I would add a more mathematically rigorous answer here:
Preliminary Concepts
We know that a random variable is a function, $X: \Omega \rightarrow \Omega'$. For the element space $\Omega'$, we have a corresponding probability space that we associate in this context, namely the $(\Omega', \mathcal{F}', \mathbb{P}_X)$ space. Here $\mathcal{F}'$ is a choice of the statistician who is doing all the modeling. In most cases when $\Omega'$ is $\mathbb{R}$, we use $\mathcal{F}' = \mathcal{B}(\mathbb{R})$ - the Borel $\sigma$-algebra. On the other hand, the choice for $\mathbb{P}_X$ is relatively fixed. It's defined as follows
\begin{align}
\mathbb{P}_X &= \mathbb{P} \circ X^{-1} \\
where, \ \ \ \ \ X^{-1}(A') &= \{\omega: X(\omega) \in A'\}\ \ \ \ \forall A' \in \mathcal{F'}
\end{align}
The $P_X$ measure is called the pushforward measure or the distribution or the law of $X$, in the literature.
Generated $\sigma$-algebra: The set $\sigma(X) = X^{-1}(\mathcal{F'}) = \{X^{-1}(A'): A' \in \mathcal{F}'\}$ is referred to as the $\sigma$-algebra generated by the random variable $X$.
Main Answer
A family $(X_i)_{i \in I}$ of random variables defined on the same probability space $(\Omega, \mathcal{F}, \mathbb{P})$ is called identically distributed if $\mathbb{P}_{X_i} = \mathbb{P}_{X_j}$ $\forall i,j \in I$
A pair of measurable sets $A,B\in\mathcal{F}$ is called independent if $\mathbb{P}(A\cap B)=\mathbb{P}(A)\mathbb{P}(B)$.
A pair of measurable families $\mathcal{A},\mathcal{B}\subset\mathcal{F}$ is called independent if this holds for every pair $A\in\mathcal{A}$, $B\in\mathcal{B}$.
A family $(X_i)_{i \in I}$ of random variables defined on the same probability space $(\Omega, \mathcal{F}, \mathbb{P})$ is called independent if the family $(\sigma(X_i)_{i \in I}$ of $\sigma$-algebras is independent.
A family of I.I.D random variables satisfies both of the above conditions.
As you can see they are identical not in their mappings from $\Omega$ to $\Omega'$ but in their pushforward measures. It's not necessary to have the same mapping to have the same pushforward measure - An example of this was aptly given by @Did in the comments below the question.
Hope this helps.
Edit: Reference - Probability Theory by Achim Klenke