Look at the picture, the electrode, the arc and the weld pool are sorrounded by the shielding gas. They have no chance to contact with air before the molten metal cools down and solidifies. That`s to say, they have no chance to react with the oxygen and nitrogen in air. They are free from contamination. Therefore, the shielding gas protects the electrode, the arc and the weld pool.