Fermat’s little theorem is a shortcut for a particular kind of remainder problem. When p is prime, raising an integer a to the power p − 1 produces a remainder of 1 after division by p, provided a is not itself divisible by p. The calculator evaluates that modular power directly, so it can also show the divisible case, where the remainder is 0.
This result is useful in elementary number theory, modular arithmetic, primality discussions and public-key cryptography. It handles powers without first writing out an enormous ordinary integer. That distinction matters: modular arithmetic is concerned with the remainder, not the full decimal expansion of the power.