How does the primary structure determine the secondary structure?
In chemical terms the polypeptide chain assumes a secondary structure driven by thermodynamic considerations. It will fold to give a structure that minimises its free energy through structures such as the alpha helix or beta sheets. The same energy considerations determine the tertiary structure. Although the polypeptide chain folds in this way to have an active biological function it is not the biological function itself that drives this folding. A polypeptide chain folds driven by these energy considerations and the resulting polypeptide chain has a biological function.