How a protein folds
Hydrogen bonds along the backbone fold a chain into helices and sheets, interactions between R groups fold it into its three-dimensional shape, and several chains can fit together, and that shape decides what the protein does.
From AP Biology.