"The king kept a strict watch upon David, hoping to find some occasion of indiscretion or rashness that might serve as an excuse to bring him into disgrace. He felt that he could not be satisfied until he could take the young man's life and still be justified before the nation for his evil act. He laid a snare for the feet of David, urging him to conduct the war against the Philistines with still greater vigor, and promising, as a reward of his valor, an alliance with the eldest daughter of the royal house. To this proposal David's modest answer was, “Who am I? and what is my life, or my father's family in Israel, that I should be son-in-law to the king?” The monarch manifested his insincerity by wedding the princess to another. PP 651.4"
Both passages describe a situation where someone is setting a trap or snare for another person, although the specifics differ. Saul is actively trying to create a situation where David will fail, while Psalm 35:7 speaks more generally about enemies setting traps. The underlying theme of malicious intent and hidden danger connects them.