David is doing the work Saul should be doing by defeating Israel’s enemies. Unfortunately, the people are not grateful for the protection David provides and side with Saul against David. It says Abiathar has his priestly garment called an ephod. That means Abiathar is acting as a priest and is seeking God’s guidance in all David does.
The difference between Saul and David in these incidents is huge. Saul thinks God is on his side and is delivering David into his hands. In fact, God is leading David so he does not fall into Saul’s hands. We should always be careful to ask God for direction rather than assume God is guiding us. We should always pray before taking action.