I asked a rabbi about this a while ago. He surmised a few possibilities, none that he knew of having any specific halachic or minhag basis mentioned.
Among many shuls that attracted primarily non-religious members, this was a means to ensure that congregants would at least have some Shabbat meal and some "connection" and Shabbat spirit. In some shuls, the meal was a bit more formal and they sang Shabbat songs and the rabbi would give a sermon or short Shabbat-related speech. Some focus was towards "kiruv".
Another aspect was purely social. I think this is more of the current trend in Orthodox shuls. I won't discuss the problem that much socializing, sadly, already occurs in shul during davening, but it shouldn't be that way. Thus, the kiddush was meant as a means for people to meet and socialize and food or a "party" is a common means or "supplement" to socializing / gatherings. (I understand that Church services, similarly have a "collation" after services. Probably for a similar reason.)
Some of the comments, above, mentioned hunger. I don't see this as the primary motive for the kiddush, at least among Orthodox crowds. Almost all Orthodox people would have their se'udah at home, anyway. (Yes, there are a few who "sneak" into the kiddush room and grab something before others or form their own private "Schnapps club" while the service still occurs. I see this as a big problem.)
The presence and sometimes even the type of food at the kiddush has become, now, a "marketing trend". People choose a specific shul on Shabbat solely based on the kiddush. IMO, that certainly should not be the main motive. However, for those shuls that may otherwise not gain a minyan, if the kiddush, alone, helps them, then, by all means, it's another reason for doing one.