1 Samuel - Chapter 29

In this Chapter David is in an impossible position.  He has pledged the support of his men to Achish, who is marching to battle against Saul and the Israelites.  If he does not fight with Achish he will be seen as either a coward, or a traitor.  But if he does fight with Achish he will be fighting against his own people.

The Holy Spirit provides an alternative solution, and the Philistine leaders tell Achish that they do not want David marching with them, and on their advice Achish sends David away,

Jesus's disciples faced a similar dilemma after the miracle of the feeding of the 5,000.  "Jesus perceived that [the people] were about to come and take Him by force to make Him king."  Jesus response was to take his disciples out of this situation:

Immediately He made His disciples get into the boat and go before Him to the other side, to Bethsaida, while He sent the multitude away.

Jesus did not want the disciples involved in a conflict that they would not understand - like David, the solution was to take them away from the battle.