Your phone using a different-besides-your-home network is called 'roaming' and it's not uncommon. For this to happen, your phone needs to know which networks it should try to authenticate against.
A while back, Sprint and T-Mobile announced they'd launch a roaming agreement for LTE that would last for 4 years, and that would be honored even if their merger doesn't go through. According to some people [1] this went into effect in Summer 2018.
[1] https://www.reddit.com/r/Sprint/comments/9548zg/tmobile_data...