It seems like a waste of vital military resources
I haven't seen the film War Horse so I can't speak specifically to it's representation, but deserters, or troops who absented themselves from their units, were pursued by the civil and military authorities.
In the British and Dominion armies the Royal Military Police were tasked with, among other things, keeping track of absent troops. Each division had its own Assistant Provost Marshal, with a small permanent group of NCOs with other ranks supplied by various units in the division. Alongside duties such as crime prevention, transport of POWs and the APM and his men operated special "straggler" posts during operations. These were intended to collect and reorganise troops who had fallen out during a march but were also used to identify potential absentees.
Individual units would report troops missing from parade and their names and descriptions would be forwarded to the APM. Small groups of marshals would be tasked with patrolling towns behind the lines, on the lookout for missing men. They would work with civil police to identify and arrest missing men, but due to language and cultural difficulties in France and Belgium this was often a challenge. Despite the stated intention of the military police to capture individuals identified as deserters there wasn't a great deal of effort put into doing so. The provost corps had many other immediate duties to carry out and so there was often little done to actively track down individual deserters.
Historian Peter Stanley talks about Australian deserters and their underground networks in his book Bad Characters: Sex, Crime, Mutiny, Murder and the Australian Imperial Force. He describes three broad varieties of absentees from the AIF. The most common group were those overstaying leave. They would have official leave granted to rear area cities in France or to the UK and simply "miss" their train or boat back to the front, staying a few extra days before presenting themselves to authorities. These were dealt with summarily by either Lines of Communication officers or by their own units, with the punishment usually being a fine and the forfeiture of pay. The second group were far more serious and were subsequently dealt with more harshly. These were men the AIF deemed "of bad character". Often petty criminals before enlistment, these men cared little for military authority or discipline and made repeated attempts at either desertion or other misconduct. These were the men who connected with local criminals to form underground networks capable of forging papers and running safe-houses for deserters. The provosts took these cases much more seriously, attempting to infiltrate these networks or finding informants. Once identified these safe-houses were often raided by the civil and military authorities, sometimes quite violently and ending in deaths. Punishment for repeat offenders was much more severe, ranging from long sentences of field punishment, imprisonment or even death. The third group was made up of men whose mental stability had been severely damaged by combat and whose nerves had gone as a result. The deserted not necessarily to enjoy time in French estaminets, but because they could not face the reality of returning to the front and likely death or mutilation. Despite the forward thinking attitudes of some military doctors towards "shell shock", many of these men were formally charged with desertion and cowardice. Many faced court martials and some were executed.
Deserters captured by military or civil authorities were dealt with through the system of military justice and courts martial. Despite many death sentences being handed down, comparatively few men were executed for desertion. There were 20,000 men in the British armies convicted of crimes that carried the death penalty during the war. Only 3,000 of them received a death penalty but only 354 of these were carried out. I can't say for the German case, but summary executions of deserters is very unlikely.