A model cannot read the word cat. It needs numbers. The easiest scheme is to give every word in the vocabulary an ID: cat is 1, kitten is 2, tax is 3, and so on down a list of 50,000 words.
That is enough to tell words apart, so it looks like a fine start. We want to use it for search: find the documents that mean the same as a question, even when they share no words.
💡Good to know
Whatever we feed a model has to become numbers first. The choice of numbers decides what the model can learn.