For the Western blot to be successful, it is a good idea to denaturate the proteins before applying them onto the gel. Denaturating is a scientific word for “straighten out”. Proteins have very complex 3D-structures (disulphide bonds), and the separation on the gel is based on size. In order to not let the 3D-structures affect the separation and give a misleading result, you need to break these bonds and straighten the proteins out, i.e. denaturate them. When the proteins are exposed to a denaturing agent, their 3D-structures are disrupted, which enables to proteins to unfold completely. Examples of such agents are β-mercaptoetanol and DTT (dithiothreitol)/ IAA (iodoacetamide).
 
Different denaturating agents may affect a protein in different ways. A good idea is to devote one Western blot run to comparing different agents in order to find out which one that most effectively denaturates your specific protein.
 

A) Denaturation of myostatin with DTT/IAA yields the strongest band at approximately 13kDa. B) Denaturation of myostatin with β-mercaptoetanol yields the strongest band at approximately 43kDa.

 
 
What do you mean with “based on size”?
 
It’s the same principle as gel filtration or size exclusion chromatography, although reversed. In gel filtration/size exclusion chromatography, smaller molecules can fit into more cavities than larger molecules, and therefore they need longer time to pass through the separation media, whereas larger molecules do not fit into the small pores and therefore wander through the media faster. Here, however, the smaller molecules come out first, since an electrical current is used to pull the proteins through a matrix. Smaller proteins have less difficulties to slip through the mesh, while larger proteins encounter more resistance and therefore need much more time than the smaller ones in order to migrate through the gel.

Also, in gel electrophoresis you do not wait for the different proteins to wander all the way through and off the gel – instead, you stop the separation when the smallest molecules have wandered to the bottom. This way, you get a pattern of different bands with the band corresponding to the protein with the smallest molecular mass at the bottom and the protein with the largest mass at the top.