Imagine you have picked $k$ elements $e_1, e_2, .., e_k$ and you want to check if two of them have the same property (the same birthday, for instance).
Then, you can fix $e_1$ and compare it with all the other elements. This give you $k-1$ sets:
$\{e_1, e_2\},\{e_1, e_3\},\{e_1, e_4\},...,\{e_1, e_k\}$
And you can fix $e_2$ and check the property for all the other elements except $e_1$, because you already checked it ($\{e_1, e_2\} = \{e_2, e_1\}$). So you get the following $k-2$ sets:
$\{e_2, e_3\},\{e_2, e_4\},\{e_2, e_5\},...,\{e_2, e_k\}$
In the same way, the element $e_3$ gives you $k - 3$ sets
$\{e_3, e_4\},\{e_3, e_5\},\{e_3, e_6\},...,\{e_3, e_k\}$
the element $e_{k-1}$ gives you only the set $\{e_{k-1}, e_k\}$ and the element $e_k$ gives you nothing.
So, the total number of sets is
$$(k-1) + (k-2) + (k-3) + ... + 2 + 1$$
and this quantity is equal to $\frac{k(k-1)}{2}$.