Say you have configured a ledger wallet with 10 BTC and 10 ETH. You then lose this said wallet but you have the 24 unique words. You buy another ledger wallet enter the 24 words and BAM, your wallet is back.
My question is where did the backup come from ? And how is it encrypted.
Using words to back up wallets is a process described in BIP 39.
Basically, the mnemonic is converted into a seed. This seed is then used as the seed to a Heirarchical Deterministic (HD) wallet, as laid out in BIP 32. The seed is used to generate a Master Extended Private Key, from which all other private keys can be generated. The child key generation follows the standard of BIP 44 so it is compatible with other wallets too.
Thus, by backing up your mnemonic words, any time you enter them in a wallet, it can recreate the seed, then the master private key, then all your other keys, so your wallet is back.
It is a common misconception that there are actual objects or chunks of data that are Bitcoin and that your wallet receives. That is actually not the case; your Bitcoin are just values attached to outputs created by previous transactions. Most of these outputs (and the type that your Ledger is designed for) require that the spending transaction contain a signature which signs the spending transaction and corresponds to a public key that was specified in the output that is being spent. That public key has a corresponding private key which your wallet knows about.
When you back up your 24 word mnemonic, what you are actually doing is backing up a number encoded as a string. That number is then later used to generate the private keys for your wallet. The generation method is deterministic, which means that given the same number, your wallet will always generate the exact same private keys. So when you restore your wallet from the 24 word mnemonic, what you are really doing is giving it the number that your previous wallet used to generate the private keys so that the new wallet generates the same private keys. This allows you to then spend the Bitcoin you already have since those transaction outputs can just be retrieved from the blockchain.
The answers given by the previous authors seem complete, the only thing we'd like to add is that the same result of a backup will occur not only with ledger wallets but also with light wallets. We've recently written an article, describing how it happens with Guarda.
Shortly, one can not only restore his wallet, using a backup / the 24 words but also unite 2 wallets in one, for example.