Great question!
From what I see in these two files: field.py 2 and vocab.py 1 it’s based on the frequency.
    for word, freq in words_and_frequencies:
        if freq < min_freq or len(self.itos) == max_size:
            break
        self.itos.append(word)

The code above ensures itos handles the max_size.