Proteins fold into their functional three-dimensional shapes due to interactions between the amino acid side chains. The primary structure of a protein is its amino acid sequence, while secondary structures like alpha helices and beta sheets form due to hydrogen bonds within the peptide backbone. Tertiary structure is determined by non-covalent interactions between the side chains that stabilize the overall three-dimensional structure of the protein. Quaternary structure refers to the interaction between multiple polypeptide subunits in a single protein.