The Xiaomi Buds 5 utilizes sensors to detect when they are removed from the ears. These sensors work by detecting changes in proximity or contact with the skin. The sweat or oil residues inside the earbuds can interfere with the accuracy of the detection signal, causing it to fail to recognize when the earbuds are removed.
When the sensor fails to detect the removal of the earbuds, it will not send the signal to pause or stop the music playback automatically. This can result in music continuing to play even after you have taken the earbuds out of your ears.
To resolve this issue, it's important to keep the detection area of the earbuds clean and free from any residues. You can do this by gently wiping the detection area with a dry tissue or cloth to ensure it is dry and free from any sweat or oil before each use.