In John 13:18, Jesus refers back to Psalm 41 when He says, "I am not referring to all of you; I know those I have chosen. But this is to fulfill this passage of Scripture: 'He who shared my bread has turned against me.'"
In David's case, he might be referring to a trusted adviser or friend who later turned against him, perhaps his counselor Ahithophel or Mephiboseth, crippled son of Jonathan. In Psalm 41, David stands alone - the object of ridicule and mocking by his enemies, and isolated by the betrayal and desertion by supposed friends. Alone, that is, except for God who David can always count on to be with Him.
When we apply this Psalm to Jesus' life, we see many parallels. His enemies were from the Jewish religious establishment and the seats of power in Jerusalem. But even His inner circle of friends had turncoats. Judas' betrayal reminded Jesus of David's experience of a friend who enjoyed table fellowship with him yet who turned out not to be trustworthy.
Perhaps we can see the pattern of this Psalm repeated in our own lives as well. Let us strive to never play the role of a false friend!