Welding is the joining together of two materials, usually two metals. This is usually done through the application of heat: the two metals melt, their liquid stages coalesce and mix, and then the combined liquid stage is left to re-solidify by cooling down.
But what if you just placed two pieces of metal on top of each other? The two sets of metal atoms at the interface between the two pieces of metal wouldn’t know which atoms belonged to which piece of metal. As Richard Feynman wrote:
“When the atoms in contact are all of the same kind, there is no way for the atoms to ‘know’ that they are in different pieces of [metal]. When there are other atoms, in the oxides and greases and more complicated thin surface layers of contaminants in between, the atoms ‘know’ when they are not on the same part.”
So if you take two very clean and very flat pieces of metal, and place them in contact with each other, in a vacuum (so that there is no air between the two pieces) they will join themselves together, in the same manner as they would if they were welded together conventionally using heat. (Usually the application of large pressures is required, so that the two pieces of metal are fully in contact throughout the entire overlapping area.)
Space is a very good vacuum, and spontaneous cold welding of metal parts aboard spacecraft is something that spacecraft designers have to plan to avoid. It is suggested that the failure of the Galileo spacecraft’s high-gain antenna was due to cold welding that had not been spotted in ground testing due to the quick formation of a protective oxide layer, which did not form in space due to the absence of oxygen.