Thank you for contacting BibleAsk.
Ahimelech was the high priest that gave shewbread to starving David at Nob. He was the son of Ahitub (1 Sam. 22:9–12), and was a descendant of Eli, for his son Abiathar fulfilled the prophecy concerning the house of Eli (1 Kings 2:27). According to the genealogy of 1 Sam. 14:3, Ahimelech was an old man when he helped David.
Abiathar might have also been high priest at the same time (Mark 2:26) – a joint position with his father Ahimelech. Or he may have been the high priest while his father was “high priest emeritus” as was Eli and his sons and Annas and Caiaphas in the time of Christ (Luke 3:2).
When king Saul killed the priests of Ahimelech’s family, Abiathar ran away with the ephod (Ex. 28:6–30), and became the priest to the outlawed David (1 Sam. 22:20; 23:6, 9; 30:7). Abiathar and Zadok are mentioned as joint high priests at the ceremony of bringing the ark of God to Jerusalem (1 Chron. 15:11, 12). Henceforth, Zadok and Abiathar are repeatedly named together as “the priests” in the ending part of David’s rule (2 Sam. 15:29, 35, 36; 17:15; 19:11; 20:25), and early in Solomon’s rule (1 Kings 4:4).
After the victories of David’s armies over various the foreign enemies, we read a list of David’s highest officials where he included the names of Zadok and Ahimelech, “the priests,” as in the parallel passage (1 Chron. 18:16). It seems that Abiathar was substituted by his son for some reason. He might have been away on a mission.
Later on, we read that Ahimelech participated in a public ceremony “Zadok the priest, and Ahimelech the son of Abiathar” (1 Chron. 24:1–3; cf. vs. 6, 31) as representatives of the two branches of the family of Aaron. On this event Abiathar was not present, for he was involved in Adonijah’s attempt to seize the throne (1 Kings 1:5–7, 19). In his absence, his son Ahimelech acted as the head of the house of Ithamar, and Zadok of the house of Eleazar. At the beginning of Solomon’s rule, Abiathar is still named, however, in the first list of high officials (1 Kings 4:4), that is, before David’s death.
In His service,