The behavior differs according to the mobile device's specifications.
When an access point with a strong signal (one that has been connected to in the past, one with open security, etc.) is detected on the list of wireless (Wi-Fi) connections set on the mobile device, the connection switches automatically.
This depends on the mobile device's specifications, but to avoid this operation and prevent the mobile device connection from switching by itself, delete that access point from the list in the wireless (Wi-Fi) settings.