Why do airfoils in an airplane's wings have different shape and size along its span?
If the airfoil profile does not change along the span, then we can expect the entire wing to enter a stall condition at the same time. This means the stall break will be sudden and sharp. 

If instead we transition between several different airfoil profiles along the span of the wing, we can get different portions of the wing to stall at different airspeeds/angles of attack/load factors, rendering the stall more gradual and furnishing the pilot with warning that the stalling process has begun. 

Furthermore, if we profile the wing so the wing root begins to stall first while the wing tip is still flying, then we can reduce the tendency of an incipient stall to roll the plane and also maintain aileron authority and hence roll controllability longer into the stall than if the wingtip and the aileron stalled first.