Whether a laptop power-adapter will spark or not when plugged in depends on a variety of factors.
Anatomy of a Power Adapter
The adapter “brick” acts as a both a surge protector and a minor UPS (uninterruptible power supply). In addition to filtering and condition the incoming power to even out minor surges and dips in the power, it also has a large capacitor which holds a relatively large current and can momentarily power the system to prevent it from shutting down in the split second of time when the system switches from battery to AC power or vice versa. If you unplug the adapter from the laptop first and then from the outlet, the little LED on it will continue to glow for a minute or so as it slowly drains the capacitor, which is actually one of the reasons for including the LED: to prevent the capacitor from holding a charge for no reason.
If you plug in a full charged laptop, the adapter does not need to charge it, so there will usually be no spark. If you plug in a laptop that needs charging (especially if it has a low battery), then there will usually be a spark as the capacitor in the adapter very quickly fills up and starts charging the laptop. If you then unplug the charging laptop and plug it back in soon, there will usually not be another spark because the capacitor already has some charge in it.
The spark you sometimes see is an electric arc and is caused by a large (often momentary) voltage jumping through the air between two conductors (often close together). Because the adapter is quickly filling up the capacitor and starting to transfer electricity to the laptop/battery, there is a moment where the voltage jumps pretty high. Because the contacts of the plug and outlet are so close together, this voltage is enough to jump through the air and cause the spark, but then everything (usually) evens out very quickly afterwards and levels return to normal.
Size Does Matter
In addition to the capacitor and the battery level of the laptop, another factor that determines whether or not you see a spark is the actual plug itself.
Most electric plugs these days are grounded, and in addition, the ground prong is a little longer than the other two (figure 1). This causes the ground conductor to connect first when you plug it in and disconnect last when you unplug (figure 2). This allows any excess current to dissipate to ground/earth.
On the one hand, this should prevent any arcing because the ground conductor should already be connected by the time that the other prongs connect, so it can easily dissipate any excess charge, but on the other hand, because the charge now has a place to go, and because the charge in such cases is large enough and the distance between the prongs is so small, having the ground connected and ready actually makes it possible for the charge to jump through the air and arc. If it were not connected, it would be at a dead-end and sit there waiting until the adapter is grounded, but that could potentially cause it to overheat or burn out, so it is better to leak the excess charge even if it makes a scary spark.
Inadvisable Tests (…or How I Learned to Stop Worrying and Love the Laptop)
You can test your own adapter by observing whether plugging it in at different angles and under different circumstances to see whether a spark occurs or not in order to determine how to plug it in to avoid it, but as stated, that could be bad for the health of the adapter (and possibly laptop), so it is better to just plug the adapter in straight and use it as designed.
Suggested Design Improvement
One way that could potentially allow for a safe connection while shielding users from the naturally concern-inducing spark would be to redesign the plug and/or outlet so that any spark occurs inside a little plastic enclave in the plug/outlet so that users don’t even notice it when it happens.
Figure 1: Photo of a grounded plug showing the slightly longer ground prong
Figure 2: Side-view of grounded photo showing the order of conductor connection