Since we have 5 pairs of shoes, in order to always have a pair of socks with each pair of shoes, we need at least 5 pairs of socks.
This way, we have at least one pair of socks for each pair of shoes.
If, for example, we have 10 pairs of socks, we would have 2 pairs of socks for each pair of shoes.
But the least number of pairs we need is 5 pair of socks.
If we have just one pair of socks, 4 of the 5 pairs of shoes would remain without socks.