Short answer get better.
More helpful answer the process is complicated. The principals are temperature, time and purity.
Clean surfaces, because any surface can not be cleaned perfectly outside a vacuum, but mechanical cleaning should always be the first step. To help we used exclusion techniques with helpers like IPI, Oil, Paste, nitrogen, freon, flux, etc. first reason for solder spikes. Contamination can create a skin on the solder that will follow the heat gradation.
Correct temperature. This issue is not simply setting a soldering iron temp and go. The factors include source temp, source thermal mass, target thermal mass, iron tip contamination, tip thermal resistance, solder specification. The good soldering irons manufactures will publish their specifications and characteristics of each of their tips as new. All the good solder manufactures will publish their solders specifications and characteristics. Every other factor is compensated for by best practices. Above I said a tip as new because as the tip is used thermal cycling, contamination and abuse the tip will age, for this we have cleaners, thinners and vacuum ovens. If a tip is cared for they can last for over a decade with nominal use (low volume assembly) and almost a year with continuous use (high volume factories with multiple shifts). The full solder data sheets are a wealth of knowledge covering irons, solder pots, wave solder etc. They use to include a lot of helpful best practice information but about 25 years ago they stopped due to a deluge of opinion claiming to know more about solder fundamentals than the manufactures. If you can find it try to find the "best practices" manual for the solder you are using. I accept for a fact 3M and Kester know the solder they make. If you follow the proper solder storage practices solder can be stored for decades. For example some of the special alloy solders I have used was over 25 years old. If not properly stored here are some rules of thumb. If the solder is corroded don't use it if you have a choice. If you don't clean, characterized, correct and compensate. If flux cored and the solder was not properly solder balled cut off 1/4" for every day it was stored for every 10C above 15C. Of course this rule will vary with the type of flux. The next reasons for solder spikes. Solder is worked it must be within the manufactures thermal band. Too low you can cause a spike caused by thermal gradation, will likely also cause a cold solder joint. Temp too high can cause wasting of the alloy components. Not all solder is simply just lead and tin. Extreme overheating with cause a detectable reddish hue. Spiking in this situation is caused by the solder trying to wet the hottest point. For proper extraction the target thermal mass must be able to keep the solder in range long enough to wet after solder tip removal.
Time is primarily dwell time. And dwell time is the most common technique to compensate for many of the above factors. Infinite heat sources, infinite thermal masses and zero thermal resistances don't exist. Too short bad joints too long damaged components, extremely too long lifted pads and wasted solder.
There are many solder techniques out there. Just please don't join the groups using the worst techniques I have seen. I call them the solder flickers and flux Bridgers. Yes it is exactly as it sounds. Solder flickers try to avoid spikes and ripples by rapidly tapping the joint causing little balls of molten solder to be flicked everywhere. Flux bridgers use a steady stream of flux to create and maintain the thermal bridge. Even with extractors causes plumes of toxic white smoke. Both insisted they where the only ones who knew how to solder correctly, yes It did cost both their position.
Hope this helps, I was purposely vague in areas to avoid the technique wars. In the end it is about getting good results without damage to the components or the people doing it. Missle/space grade soldering has been drilled into me for decades, but I accept not every solder joint needs to be perfect. After how many companies inspect every joint with X-ray and microscope, very few. I just isn't required for most soldering.
Sorry got a bit longer than intended.
Sent from my iPad using Tapatalk