How are the labels in class indices created while call get_batches function?

While checking the class indices for the batch of images created using get_batches I found the value to be a dictionary similar to the class indices json - {‘cats’: 0, ‘dogs’: 1}

How are these labels being generated. As far as I understand the function get_batches takes the path to a directory, and generates batches of augmented/normalized data.

How does get_batches know which label to assign in class_indices?

I am not sure if I am missing out something or I have not clearly understood the function.