What is the operation logic of the automatic disconnection and re-connection of the Xiaomi Buds 5?

The logic of automatic disconnection when the earbuds are placed in the charging case is as follows:
1. After the earbuds are placed in the charging case, if the lid is open, the connection will remain;
2. After the earbuds are placed in the charging case, if the lid is closed, the earbuds will disconnect from the device automatically after 5 seconds.
The logic and operation method of re-connection are as follows:
1. If you return within 10 minutes after disconnection, the earbuds can be reconnected automatically. After more than 10 minutes, the earbuds enter sleep mode. At this time, it can be reconnected again automatically after wearing it once;
2. If the earbuds cannot automatically reconnect to the mobile phone, please try to put the earbuds back into the charging case, close the lid and wait for 5 seconds, then operate the phone to connect to the earbuds again;
3. If the above step is unable to reconnect, please restart the Bluetooth connection on the mobile phone. Press and hold the charging case function button for 2s. After the charging case indicator flashes and enters the pairing mode, reconnect the mobile phone.