We can show that if $f: A rightarrow B$ is injective then $|A| leq |B|$ and if $g: B rightarrow A$ is injective then $|B| leq |A|$ so $|A| = |B|$. By the definition of having equal cardinality, there exists a bijection between $A$ and $B$.
Whenever a textbook proves the theorem, however, a more complicated proof is shown. I must be missing something.