The short explanation from the long one - udev. Udev detects devices in arbitrary order depending on presence e.g. plugged after boot or plugged when booting.
You cannot format a device while mounting - so the best you can do is to launch your system’s GUI partition manager, locate the device and format the partition to the desired filesystem.
If the device is USB stick you can use this script
If it is internal disk or USB removable disk with several partitions you can use your preferred partition manager. Then create mount units for it.