My understanding of Tor is that each relay peels back a layer and forwards what's left. But why can't the first relay simply unpeel all of the layers and see what the actual data is?
These "layers" in Tor are actually layers of encryption, where each relay only knows how to remove a single layer. As a client builds a circuit, the client performs a key exchange with each of those relays so that the client shares a different set of keys with each relay. Before a client sends a cell along a circuit, it encrypts the cell once with each forward encryption key, and since each relay knows only one of the decryption keys, the cell must be decrypted once by each relay before the original plaintext can be read.