Psalm 41:9 laments betrayal by a close companion: one who shared the psalmist's bread and enjoyed his trust turns against him. In David's historical experience the verse concerns personal treachery, but it becomes an important pattern for understanding the betrayal of Jesus.
John 13:18 explicitly quotes Psalm 41:9 as Jesus prepares His disciples for Judas's betrayal: "He who ate my bread has lifted his heel against me." Jesus says that He is telling them beforehand so that, when it occurs, they may believe who He is. The New Testament therefore directly applies David's experience to Christ. Judas, a member of Jesus' intimate circle who shared meals with Him, fulfills in a heightened way the treachery described by the psalm.