The expression is a corruption of the now defunct hab-nab in turn a shortening of old English habbe (hit) and nabbe (miss). This took on the implication of give & take and this giving and taking (of drinks) is one of the hallmarks of hob-nobbing.
In 1811 it was Will you Hob or Nob with me? If the party so questioned replied nob they were deemed to have agreed to have a drink of wine with the proposer and had to choose red or white wine. The 1811 suggested origin goes back to the days of good queen Bess when great chimneys were in fashion. On each corner of the hearth or grate was a small projection called the hob. In winter beer was placed upon the hob to warm and cold beer was set upon a small table, said to have been called the nob and so the question will you hob or nob with me? appears to be an invitation to warm or cold beer.