Then David came to Nob to Ahimelech the priest. And Ahimelech came to meet David trembling and said to him, “Why are you alone, and no one with you?” And David said to Ahimelech the priest, “The king has charged me with a matter and said to me, ‘Let no one know anything of the matter about which I send you, and with which I have charged you.’ I have made an appointment with the young men for such and such a place. Now then, what do you have on hand? Give me five loaves of bread, or whatever is here.” And the priest answered David, “I have no common bread on hand, but there is holy bread—if the young men have kept themselves from women.” And David answered the priest, “Truly women have been kept from us as always when I go on an expedition. The vessels of the young men are holy even when it is an ordinary journey. How much more today will their vessels be holy?” So the priest gave him the holy bread, for there was no bread there but the bread of the Presence, which is removed from before the LORD, to be replaced by hot bread on the day it is taken away. – 1 Sam 21:1-6
One Sabbath he was going through the grainfields, and as they made their way, his disciples began to pluck heads of grain. And the Pharisees were saying to him, “Look, why are they doing what is not lawful on the Sabbath?” And he said to them, “Have you never read what David did, when he was in need and was hungry, he and those who were with him: how he entered the house of God, in the time of Abiathar the high priest, and ate the bread of the Presence, which it is not lawful for any but the priests to eat, and also gave it to those who were with him?” And he said to them, “The Sabbath was made for man, not man for the Sabbath. So the Son of Man is lord even of the Sabbath.” – Mark 2:23-28
Really, we need to slow down a bit and read what Jesus actually said before we get too excited or upset. Jesus didn’t say that Abiathar gave David the bread, he said that in the days when Abiathar was the high priest David ate the bread of the presence. That doesn’t conflict with 1 Samuel at all. Ahimelech was the priest on duty when David came looking for food. Abiathar was the high priest but that didn’t mean that he was at the tabernacle at that time. He had specific duties and at appointed times he would be there. But he wasn’t when David came.
But the panic isn’t over yet. In 1 Samuel what happened next is that Saul found out what the priest had done for David and he slaughtered them. Only Abiathar, the son of Ahimelech survived and escaped (1 Sam 22:20). But how could Abiathar be the high priest and the son of a serving priest? Actually, it could happen. It isn’t clear at this point in Israel’s history how a high priest was chosen. If you look in the Law (Exodus through Deuteronomy) you’ll find that the term “high priest” is only used a few times in Numbers. There is no biblical criteria for who would be the high priest so it could have been Ahimelech’s son. Or another priest name Abiathar. Again, not a big deal.