In addition to all the good content in all the other good answers, one more point should be made: when the airmass is moving horizontally and/ or vertically, the glide ratio over the ground is different than the glide ratio through the airmass, and therefore the glide ratio over the ground is different than the L/D ratio.
When gliding into a headwind, the maximum obtainable glide ratio relative to the ground is higher when the glider is heavy than when it is light. You easily verify this for yourself: starting with the second diagram in this related answer, extend the horizontal axis left far enough to include the origin of the graph. Now put your pencil on the point (x=50 kph, y=0). Starting from this point (x= 50 kph, y=0), the slope of a line drawn tangent to the airspeed-versus-sink-rate curve is the highest obtainable glide ratio in a 50 kph headwind in air that is neither rising nor sinking. You can see that the line drawn tangent to the ballasted curve is flatter (i.e. has less slope) than the line drawn tangent to the unballasted curve.
When we consider that when a glider flies a task that returns to the starting point on a windy day, it invariably spends more time flying with a headwind component than with a tailwind component, this is not a trivial point.
Naturally, this effect is even more pronounced if we draw our tangent line from (x=100 kph, y=0), representing the best achievable glide ratio when flying against a 100 kph headwind.
When slope-soaring a radio-controlled miniature glider in strong wind, it is not uncommon to encounter conditions where a lightly-loaded glider has difficulty making any forward progress at all and just sinks almost vertically down to the ground, while a heavily-loaded version of the same aircraft can be flown much closer to the max L/D angle-of-attack and thus can race forward at high speed while maintaining altitude or climbing.
Similarly, if we take the graph discussed above and extend the y axis upward so that extends into positive values for y, and start drawing our tangent line from the point (x=0, y=.2 m/s), we can find the highest obtainable glide ratio relative to the ground in the presence of a .2 m/s downdraft and zero headwind/ tailwind. Again the line drawn tangent to the ballasted curve is flatter (i.e. has less slope) than the line drawn tangent to the unballasted curve. In a downdraft, the maximum obtainable glide ratio relative to the ground is higher when the glider is heavy than when it is light. Since the air between thermals is often sinking to some degree, this is not a trivial point either. One instance where a glider pilot is most likely to be interested in maximizing his or her glide ratio over the ground is when he or she is flying in sinking air, and in this situation ballast helps.
The same method can used to find the maximum obtainable glide ratio relative to the ground in air that is sinking and includes a headwind component. In this case ballast really helps a lot-- the maximum obtainable glide ratio relative to the ground will be much higher in the ballasted glider than in the unballasted glider.