This seems to be a common concern among new Spark owners and with all the videos online talking about it it's not hard to understand why. From what I've read and watched, there seems to be two main types of flyaways and both are not confined to just the Spark.
First and by far the most common is when the craft drops GPS positioning and reverts to ATTI mode (if flying the Spark above 10m) which is usually proceeded by a notification of a compass error which may be due to some form of magnetic interference. Most times the craft will regain GPS positioning in a few seconds and be able to hover in place but if it doesn't and there is any amount of wind the craft will quickly drift off making the situation look like the AC is purposely flying away itself. It's not and it's up to the pilot to fly the craft back with stick control which you will still have in most of these type situations. If the craft flies out of RC range and loses connection, it can still return to the HP on its own if GPS positioning returns at some point and enough
battery power remains.
Keep in mind that winds are always higher at altitude than ground level so many don't even realize that wind is a factor. Also, a lot of new pilots are not familiar with ATTI mode so they're unable to control the craft properly or make the situation worse by pushing the wrong way on the sticks. To the uninitiated, this looks and feels like the bird grew a brain and flew off on its own. BTW, pressing the RTH button while in ATTI mode won't help you as the craft is not using GPS for positioning which is needed to help find the HP. If the craft goes back into GPS mode at some point during the flight then the RTH function will work properly.
The second type of flyaway seems a bit more mysterious and much more rare. There may be no errors pop up on the GO4 app and stick control doesn't appear to respond even with the RC still connected. The craft may fly away very quickly as well even though winds are low. For a recent example, check out this
video by Don Joyce with his Mavic.
The cause of such flyaways seems unclear from what I've seen on the topic so far. However I would say that anytime you have a technology that is composed of firmware, software and hardware there is always a chance of an unexpected error happening. I think it's a testament to DJI that it happens as rarely as it does. But when it does it can be a very scary experience for the pilot. That's why it's always so important to fly within the rules and to take precautions when and where you fly and to get to know your aircraft as much as you can. You're in the right place to do that! ? Here's also a good guide to feast on:
Prevent a Crash or Flyaway with Your DJI Drone (The Complete Guide).