We use the term "bad GPS data" to describe any circumstance where your GPS device records location (or other) data that does not accurately represent your activity. Bad GPS data can result in your activities on Strava having missing or extra distance recorded; segments not matched at all or recorded inaccurately; inaccurate elevation data; inaccurate achievements such as estimated best efforts; and more.
There are many factors that contribute to the accuracy of your GPS data - and it's important to keep in mind that no data is perfect; in fact, there is some degree of error inherent in any GPS recording. Ignoring (for now) environmental factors, different devices have different qualities of GPS hardware and software - meaning that even if your device is working at its peak performance, there will always be a margin of error in the accuracy of its recording.
GPS works by connecting your device to a number of overhead satellites and very precisely measuring the amount of time it takes for a signal to travel between your device and the satellites. Because the speed at which the signal travels is known, the amount of time the signal is in transit allows your device to calculate the distance to each satellite. Since the position of each satellite is known, as well as the distance between those satellites and your GPS device, your position can be triangulated. More information can be found here.
Because we're dealing with extremely fast signals requiring precise detection, any slight inaccuracy in the signal's reception, or disturbance to the signal itself, can translate to a significant dislocation of your reported position. Consequently, environmental factors such as dense trees, steep hillsides, tall buildings, or even heavy cloud cover can impact or even interrupt the travel of the GPS signal between your device and the satellites.
While Strava does its best to optimize our data analysis by ignoring the most obviously inaccurate data, in the end, we can only make the most out of the data provided to us from the GPS device. Put another way, when a device records bad GPS data, the only option that Strava has to improve it is to ignore portions of that bad data. Unfortunately, when, for whatever reason, a portion of your activity isn't recorded by GPS, it is not possible for us to "fill in" the missing data or "correct" the bad data. However, you do have a few good options to get credit for your efforts and manage the way that GPS data is represented by activities:
Thankfully, there is more that can be done to prevent bad GPS data from being recorded than there is to repair it. As previously mentioned, different devices do simply have different qualities of GPS hardware, so although there are some tips and tricks that are device-specific, there are also some key practices that can help improve your GPS data quality regardless of what device you're using.