What you describe is word2vec which is one kind of word embedding that is pre-learned. Often (with keras at least ), embedding is learned simultaneously with the deep learning network. Keras uses index of words to progressively adjust a set of randomly initialized n-dimensional vectors. I’m telling you because I feel it may be the case for you too. The various kind of embedding was very confusing at first.
However, I just marvel at word2vec when I stumbled upon it. Encoding of meaning as vector dimensions was mind expanding for me.