We don’t use the word hobnob as Shakespeare did.
With us it is a verb, to hold intimate conversation with (another); to be convivial with.
But Shakespeare used it (Twelfth Night, III, iv) as an adverb:
“He is (a) knight . . . ; but he is a diuell in a private brall; . . . and his incensement at this moment is so implacable, that satisfaction can be none, but by pangs of death and sepulcher. Hob, nob, is his word: giu’t or take’t.”
And the sense then was that of the earlier hab nab, “have it, have it not”; hence, “give or take,” “hit or miss.”
The supposition is that our present sense developed from social drinking among two or more with clinking of glasses, giving or taking wine with one another alternately.
So, at least, was the occurrence of the expression onward from the eighteenth century.