If there are e.g. $2$ sets $X,Y$ then the Cartesian product $X\times Y$
can be looked at as a set of ordered pairs: $\left\{ \left\langle x,y\right\rangle \mid x\in X\wedge y\in Y\right\} $.
But what if you want a notion of Cartesian product concerning a whole
bunch of sets? Let's say we have the sets $X_{i}$ where $i$ ranges
over indexset $I$. Then functions take the place of the ordered pairs.
Elements of $\prod_{i\in I}X_{i}$ are functions $f$ having $I$
as domain and with $f\left(i\right)\in X_{i}$ for each $i\in I$.
We want to give these functions a common codomain. Note that for every
$i\in I$ the set $X_{i}$ must be a subset of the codomain of these
functions leading to the set $\bigcup_{i\in I}X_{i}$ as codomain.
This together gives the definition that you mention in your question.
In the example that you mention: $\left\{ 1,2\right\} \times\left\{ 2,3\right\} =\left\{ \left\langle 1,2\right\rangle ,\left\langle 1,3\right\rangle ,\left\langle 2,2\right\rangle ,\left\langle 2,3\right\rangle \right\} $
we need an indexset $I$ that has exactly $2$ elements and we can
do it with $I=\left\{ 1,2\right\} $ as you propose.
Then e.g. element
$\left\langle 1,3\right\rangle $ corresponds with function $f:\left\{ 1,2\right\} \rightarrow\left\{ 1,2,3\right\} $
that is prescribed by $1\mapsto1$ and $2\mapsto3$.
Well, on a practical and obvious level . $A \times B$ = a set of ordered pairs so $P(A\times B)$ = a set of sets of ordered pairs. $P(A)$ = a set of set of elements. So $P(A) \times P(B)$ = a set of ordered pairs of sets.
It might seem abstract but a set of ordered pairs of sets = {({..},{....})}, is completely different than a a set of sets of ordered pairs. {{(x,y)}}.
e.g.
P({1,2} X {3,4}) = P({(1,3),(1,4),(2,3),(2,4)}) = {$\emptyset$, {(1,3)},{(1,4)},{(2,3)},{(2,4)},{(1,3),(1,4)},{(1,3),(2,3)},{(1,3),(2,4)},{(1,4),(2,3)}{(1,4),(2,4)},{(2,3),(2,4)},{(1,3),(1,4),(2,3)},{(1,3),(1,4),(2,4)},{(1,3),(2,3),(2,4)},{(1,4),(2,3),(2,4)},{(1,3),(1,4),(2,3),(2,4)}}
wherease P({1,2})X P({3,4}) = {$\emptyset$, {1},{2},{1,2})X ($\emptyset$, {3},{4},{3,4}) =
= {($\emptyset, \emptyset$),($\emptyset$, {3}), ($\emptyset$, {4}),($\emptyset$, {3,4}),({1}, $\emptyset$),({1}, {3}), ({1}, {4}),({1}, {3,4}),({2}, $\emptyset$),({2}, {3}), ({2}, {4}),({2}, {3,4})({1,2}, $\emptyset$),({1,2}, {3}), ({1,2}, {4}),({1,2}, {3,4})}
Different things. By coincidence they both have 16 elements.
In general:
$|A \times B| = |A| * |B|$
$|P(A)| = 2^{|A|}$.
So $|P(A \times B)| = 2^{|A||B|}$ while $|(P(A) \times P(B)| = 2^{|A|}2^{|B|}=2^{|A| + |B|} \ne 2^{|A||B|}$
so we know this can't be true.
Best Answer
You're right that $\{1,2\}\times\{3,4\}=\{(1,3),(1,4),(2,3),(2,4)\}$.
However, remember that the condition in the set builder notation is for asking whether one thing at a time is an element of the set. We ask:
Is $x=(1,4)$ in $A\times B$? Yes it is, because $(1,4)=(a,b)$ for some $a\in A$ and $b\in B$, namely $a=1$ and $b=4$.
But $(1,4)$ does not equal $(a,b)$ for all $a\in A$ and $b\in B$ -- for example $(1,4)\ne(a,b)$ when $a=1$ and $b=3$.
So requiring of an $x$ that it equals $(a,b)$ for all choices of $a$ and $b$ would be too much to ask. No possible $x$ can meet that condition, so your set would end up being empty (unless both $A$ and $B$ are singletons).