A cute pun on beg, involving beg ‘ask for something, typically food or money, as charity or a gift’ (NOAD2) and the idiom beg to differ ‘politely disagree’. As it turns out, these two uses of beg are historically related.
Highlights of the history of beg from OED2 (though I should note that this entry seems to be almost entirely carried over from OED1, so that it’s a hundred or so years old and somewhat out of date):
1. To ask alms or by way of alms.
a. trans. To ask (bread, money, etc.) in alms or as a charitable gift; to procure (one’s living) by begging. [from Middle English]
b. intr. To ask alms; esp. to ask alms habitually, to live by asking alms. Const. absol.; of, from, formerly at, a person; for alms. [from Middle English]
2. transf. To ask as a favour or act of grace; hence to ask humbly, earnestly, supplicatingly; to crave, entreat.
a. trans. Const. of, from (formerly at). [ME] [favours to beg of you etc.]
b. absol. or intr.; with same const. [1598 on]
c. To beg for a thing. [1576 on]
d. To beg to do a thing, or that a thing may be. [1576 on]
†e. To beg of a person for a thing. Obs. 
f. To beg of (formerly at) a person to do a thing, or that a thing may be. [a1616 on]
g. trans. To beg a person to do a thing. [1675 on] [begged him to explain himself etc.]
3. a. In beg pardon, beg excuse, beg leave, etc.: beside the strict sense as in 2, the whole expression is often merely a courteous or apologetic mode of asking what is expected, or even of taking as a matter of course. [1604 on]
b. ellipt. for beg leave at sense 3a. [1767 on]
1898 Westm. Gaz. 29 Oct. 7/3 You say, ‘I beg to take exception’, which, of course, is not English at all. You mean, ‘I beg (leave) to take exception’.
6. To take for granted without warrant; esp. in to beg the question: to take for granted the matter in dispute, to assume without proof. [1581 on]
OED2 has no subentry for beg to differ, and in fact the idiom appears in the dictionary only in a cite under agree:
1942 L. V. Berrey & M. Van den Bark Amer. Thes. Slang §347/2 Disagree, agree to disagree, beg to differ.
But it does appear in NOAD2, under differ, and in some idiom dictionaries, for instance the American Heritage Dictionary of Idioms (by Christine Ammer, 1997):
This courteous formula for expressing disagreement echoes similar uses of beg in the sense of “ask,” such as I beg your pardon, so used since about 1600.
“About 1600″ is an allusion to subentry 3 in the OED (above). Presumably, beg to differ is (doubly) elliptical for something like beg leave to differ with you — the first ellipsis as in subentry 3b above, the second omitting the oblique object complement with you of differ (compare: Kim thinks that pigs can fly, but I differ).
The other sense of I beg to differ (with beggar beg) in the cartoon also involves ellipsis of an oblique object complement of differ, but here the complement is something like from (other) people (compare: Most people like ice cream, but I differ).
Finally, the two readings of I beg to differ in the cartoon differ structurally. In the idiomatic interpretation, the infinitival VP to differ is a complement of beg, while in the beggar interpretation, the VP to differ is a purpose adverbial modifying beg and understood as ‘in order to differ’.
What makes the cartoon work as a joke is that the idiomatic interpretation is so much easier to get than the beggar interpretation that it takes a moment for you to realize that the idiomatic interpretation cannot be the intended one in the context, so you have to see beg to differ in a new light.
1. beg the question, as in the OED subentry 6 above, has been the subject of much commentary and complaint, over the three senses (from NOAD2):
1(of a fact or action) raise a question or point that has not been dealt with; invite an obvious question. 2 avoid the question; evade the issue. 3 assume the truth of an argument or proposition to be proved, without arguing it.
These are listed in NOAD2 roughly in order of their frequency of use these days (most frequent to least), which is in fact the opposite order to their appearance in the language. For Language Log discussion, see
comment from möngke on ML, 4/18/10: Icelandic: no word for “please”, 45 words for “green”? (link)
ML, 4/29/10: “Begging the question: we have answers (link)
ML, 5/1/10: “Begging the question”: we have examples (link)
2. The agent-noun beggar derived from beg has been verbed, first in the straightforward sense:
To make a beggar of, exhaust the means of, reduce to beggary; to impoverish [OED2 cites from 1528 on, figurative cites from 1642 on]
and then in an extended sense:
To exhaust the resources of, go beyond, outdo; as in to beggar description, compare [‘comparison’], etc. [cites from a1616 on]
And then there’s an assortment of other idioms, some mentioned above, but also including beg, borrow, or steal; beg off; beg someone’s pardon; and go begging.