There’s a bit too much focus on “Front” and “Rear” here to be accurate for the time period. These are actually comparatively modern concepts.

Simply put for much of history, there was no assumption that you would have a large and fairly politically unified strategic interior feeding men and materiel up to a line of contact, on one side of which (partisans not withstanding) you could expect to realistically exercise governance and move men and supplies fairly risk free, while on the other was the enemy who’s extended presence along the line safeguarded his own operational and strategic depths full of useful political and economic objectives.

So modern in fact, that in the 1920s and 30s military theorists are still writing about it as a problem that had to be solved. While what we would think of as linear strategy starts evolving before that - Schlieffen writes “Cannae” about it - but it becomes increasingly “strategy of the point” as you go back in history. Which is to say operational art (such as it were) primarily concerned itself with maneuvering forces on a comparatively open canvas to arrive at a single point where it would seek either the destruction of an enemy force or seizure of a singular point of importance, and away from that point notions of “front” and “rear” lose most of their meaning.

Take the Crecy campaign as a single example, useful because it contrasts so well with the allied advance of WW2. The English land in Normandy, sack Caen, raid Rouen, and eventually march all the way to Calais which they besiege for just short of a year, but not before the famous battle. During that time they leave multitudes of castles in their “rear” to no great detriment, because they are supplied predominantly by the land they are on, not lines of supply. When they are trapped short of food, it’s because the French removed it all prior to their arrival near the Somme. Rather than return to the “rear” back to Normandy, the English break through to the NE, or “front” - forcing the French to pursue, the French who it must be noted spend a decent portion of the campaign with the English in their “rear”.

In the interim, it is not as if everything to the “rear” of the English army was now English…it was still French, with a multitude of castles and towns untaken. And when they fight Crecy even though “enemy territory” is to their “front” on the way to Calais, that is considered a good line of retreat to the coast.

In all that time, one, perhaps two, major field actions are fought at specific points, the rest of the time spent either with armies assembling, marching around, or besieging things.

———

With that in mind the castle is really more about preservation of governance, wealth, your own skin, and of course the forces that make you a lord, not some intricate series of forts meant to force a threat to an enemy “rear” or allow for sudden decisive operational strokes (your adversaries after all also have castles…it’s not like your garrison gets bypassed and now you have a shot at the capital!)