The batch size is a number that indicates how many training data units to adjust the weight and bias parameters.
The weight and bias parameters are adjusted using the average of the gradients of multiple training data.
If there are 50,000 training data and the batch size is 10, 10 pieces will be processed 5000 times.
When the batch size is 1, it is called online learning.
When the batch size is 1 or more, it is called mini-batch learning.
When the batch size is the same as the total number of training data, it is called batch learning.
Which batch size has good learning efficiency depends on the data, so it seems that it is set by intuition.