Question: What is the literal meaning of "auf der Strecke bleiben"? What is the link between the literal meaning and the meaning "to fall by the wayside"?

Answer: 
My first idea has been that the expression is related to the retreat of Napoleon's Grande Armée from Russia (or similar events), when many soldiers died of physical exhaustion, wounds, cold or whatever reason on the side of the road. It seems that this explanation isn't correct, though.

Instead the expression comes from hunting. *Jemanden zur Strecke bringen* and *auf der Strecke bleiben* share the same origin ([redensarten.net](https://www.redensarten.net/zur-strecke-bringen/)):

> 
> Etwas zur Strecke bringen im wörtlichen Sinn seit langer Zeit vor allem Jäger, und zwar nach erfolgreicher Jagd das geschossene Wild. Das wird bei größeren Jagden mit mehreren Beteiligten an einen Sammelplatz fein säuberlich in Reih und Glied, sortiert nach Art und Größe, ausgelegt. Diese Aufreihung nennt der Waidmann Strecke. Dabei kann man Strecke von „strecken, gestreckt“ herleiten, weil die Jagdbeute wortwörtlich alle viere von sich streckt, nachdem sie tödlich getroffen wurde.
> 
> 
> 

The "Strecke" is a place to which hunters bring the animals which they have shot.

P.S.: I hadn't read all answers before I wrote my own. @ChristianGeiselmann had already given a similar explanation. ~~However, *Strecke* is not a quantity - but a place.~~ *Jagdstrecke* or short *Strecke* can also be used to designate the total number of animals shot during a hunt.

P.P.S.: If you want to see a "Strecke", you can use the Google image search for "Strecke Jagd". Most images are not released under a licence, which would allow to use them here. The photo below shows the "Strecke" of a driven hunt on hares. As seeing such a number of animal cadavres may provoke a strong negative reaction, I use spoiler tags.

> 
>  [![image](https://i.stack.imgur.com/v8Vgd.jpg)](https://i.stack.imgur.com/v8Vgd.jpg) Image from: [common.wikimedia.com](https://commons.wikimedia.org/wiki/File:Drijfjacht_Strecke_Hazen_PM10.jpg)
> 
> 
>
Imagine an army making a forced march, maybe being pursued by enemy troops. Some soldiers will run out of energy to march on and collapse so they stay on the track instead of reaching the destination.