It is the extreme heat of the welding process that causes the annealing.
The weld will be the softest part of the frame after it is welded. There are a number of different types of welding wire to chose from 4043, 5356 etc. Not all of them are heat-treatable, some will not precipitation harden.
The process of heat treating a bike frame (6061) would involve heating the whole frame (super saturated solid solution) then quenching in water. This would induce some distortion and would do little to stress relieve it.
Further heat would then be require to precipitate harden it, to get peak strength.
“It is not easy to make materials that are both strong and tough. All the [aluminium] alloys have a higher strength and lower toughness than pure aluminium”
Materials engineering, science, processing and design. Michael Ashby, Hugh Shercliff, David Cebon.
The precipitation hardening heating process (6061) is by coincidence at a similar temperature and time as that for powder coating.
A good weld needs as high a standard of weld preparation /cleanliness as possible to avoid contamination.