Why wings of an airplane consist of different shape and size of airfoil. What will happen if the thickness of wing are same throughout the wing?
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.
"What would happen if the thickness...are same throughout the wing".
This is known as a "Hershey bar" wing, and is an excellent general purpose, easy to build wing for models and full scale aviation aircraft alike.
Aircraft designers add twist or "washout" to wings to prevent the entire wing from stalling at once. Washout lowers the angle of attack of the wingtips a few degrees as compared with the wing roots. That, along with inboard flaps (near the roots), helps insure that the stalled airflow condition starts near the roots, rather than near the wing tips.
Tapered wings of varying thickness came along in the 1930s to deal with increased (wing) spanwise stress loads of larger and faster aircraft, and are particularly valuable in efforts to increase roll rate and reduce drag, hence they are seen in long distance cruising aircraft today such as gliders and airliners. Leading edge slats make these wings much safer, but they are more complex and expensive to build.
The simple, reliable, lower aspect rectangular wing form, set high with a little dihedral as seen on the Cessna 172, remains a good choice for a recreational aircraft.