The bitcoin system works through a secure public ledger called a blockchain. A coded and password-protected (but anonymous) entry on the ledger records ownership of the bitcoin.
Not really anonymous. In fact the ledger of transactions is how the federal government has prosecuted people conducting various crimes financed by Bitcoin.