Not getting ImageDataGenerator

from tensorflow.keras.preprocessing.image import ImageDataGenerator

//All images will be rescaled by 1./255.
train_datagen = ImageDataGenerator( rescale = 1.0/255. )
test_datagen = ImageDataGenerator( rescale = 1.0/255. )

//Flow training images in batches of 20 using train_datagen generator
train_generator = train_datagen.flow_from_directory(train_dir,
target_size=(150, 150))
// --------------------
//Flow validation images in batches of 20 using test_datagen generator
validation_generator = test_datagen.flow_from_directory(validation_dir,
class_mode = ‘binary’,
target_size = (150, 150))

The use of ImageDataGenerator is to convert the image in to 0-1 scale using rescale parameter, right?
so, my question is that,
Why train_generator and validation_generator is used?

Here are the main reasons for using a data generator:

  1. Support for batching without holding the original dataset in memory.
  2. Performing pre-processing and augmentation of model inputs.

In pre-processing what it actually does?