Why should Bnei Barzilai eat on Shlomo's table?
Malbim: This is Midah k'Neged Midah (they fed me).
How did they come close to David?
Radak, based on Targum Yonasan: They gave to him food and drink 1 (Shmuel II, 17:28-29, 19:33).
In Sefer Shmuel, it does not mention giving to him to drink. Also, it says that Barzilai gave. It does not mention his sons. Granted, he was too old to bring all the food by himself. However, perhaps his servants brought it! We must say that our verse reveals about both of these. (PF)
Why does it mention "when I fled Avshalom"?
Malbim: Then, they did not anticipate that I will reward them.
Mishnas R. Aharon 4 p.25: Barzilai gave to David Lechem Nekudim 1 (toasted bread, hard, crumbly crackers or pretzels, or moldy bread - Rashi and Radak, Yehoshua 9:5). Normally this is disgraceful to give to a king, and one is Chayav Misah for this! However, when the king is exiled and fleeing for his life, the smallest gift is worth a great amount. Likewise, at a time of slackening in Torah, any learning has great value and reward.
What is his source that he gave Lechem Nekudim? Everything mentioned (Shmuel II, 18:28-29) is dignified, except for barley, which was considered to be primarily for animals (Pesachim 3b)! (PF)