By definition, the Carmichael function maps$a $positive integer $n$ to the smallest positive integer $t$ such that $a^t\equiv1\pmod n$ for all integers $a$ with $\gcd(a,n)=1$. It is denoted as $\lambda(n)$.
The Wikipedia page on Carmichael function states that $\lambda(n)=\max\{\operatorname{ord}_n(a):\gcd(a,n)=1\}$. My question is: why is this true? In other words, why is it the case that there always exists an integer $x$ coprime to $n$ with $\operatorname{ord}_n(x)=\lambda(n)$?