The word comes from India, where a pandita was (and still is) a very learned or wise person well versed in Sanskrit and Indian philosophy, religion, and law. It is one of quite a few Indian words that the British adopted during their time in the subcontinent. In the mid-19th century, at the height of the Raj, the British used the word to designate an officer in the Indian judiciary with the responsibility of advising British judges on questions of Hindu law, or an Indian person trained and employed to survey regions beyond the British frontier.
But the word took on a life of its own beyond India's borders, being used to mean "expert" by the beginning of the 19th century, oddly enough predating the noun "expert" itself by about 50 years, though the adjective "expert" (derived from the Latin experire "to experience") had been around since Chaucer's time.
By the early 20th century it had acquired its derivative "punditry", to which has been added more recently "punditocracy".
To me "pundit" has a slightly disparaging tone to it. While acknowledging that the pundits are specialists in their field, the word does suggest to me an opinion for hire willing to spout off in the media. I doubt that news anchors or moderators would refer to their experts as pundits to their faces. What do you think about the connotations of this word?