Beam shape
The stress diagrams below show that most of the stress occurs two thirds of the distance from the neutral axis, so this is where a beam requires most of the structural material. Rectangular sections are wasteful of material compared with an I beam which is very efficient.
Generally the further the structural material is from the centroid, the more structurally efficient the beam will be. However, if it is too far from the centroid, the beam will reach a stage when the member becomes too slender and will buckle.