There are 26 people total: you and 25 other guests. You shake hands with all 25 guests. We want to show that among those 25 other guests, at least two must have shaken hands with the same number of people.
Since you shake hands with everyone, each of the 25 guests gets an automatic +1 to their total. So it is enough to look only at handshakes among the 25 guests themselves.
For the 25 guests, a person could shake hands with 0, 1, 2, ..., 24 of the other guests. That looks like 25 possible values.
Now we compare the number of people (pigeons) with the number of available handshake counts (holes).