I'm curious to know if there is any historical context for the following anecdote, or on the other hand, if it is just something Napoleon probably could have said but has no actual source.
A French general is entrusted by Napoleon to defend a length of the border with a force of a certain size. The general is showing off his efforts to Napoleon: by dispersing his troops, he is able to cover the entire length of the border (or at least the area he is responsible for).
Napoleon replies, "That's nice. And what do you expect to accomplish with this - preventing smuggling!?"
I did a check through a few Napoleon biographies and couldn't find any specific mention of this quote, but I actually do think Napoleon said it, or could have said it.
So Napoleon's philosophy of warfare was all about the decisive battle. Napoleon didn't want to spend months/years chasing little armies around with large sieges. He wanted to get his opponents army, or a large part of it, in a single area and crush in a decisive battle, ending the war quickly. Think the battles of Ulm or Austerlitz.
Also, one of Napoleon's heroes (or at the very least someone he admired very much) Frederick the Great once said:
He who defends everything, defends nothing
So in this case Napoleon is berating the general because by splitting up his forces to guard the entire border, the general has: made his forces more vulnerable to an attack by the enemy, made his troops less effective by splitting them up, and by trying to defend everything the soldier is not adhering to Napoleon's style of warfare.
So even if the quote is fake, it certainly fits in with what Napoleon would have thought.