A faucet makes it easy for developers to to obtain some tokens to test with.
Off course, this is only ran on testnet or a devnet.
The faucet does not create any tokens, it simply talks to a local daemon with a funded wallet to authorize an address or to send some tokens to the requested address.
Besides using the website, the api can also be called directly.