iOS autodetects and automatically switches languages as you described. The globe icon is just for switching key layouts. Language is independent of key layout.
This is also consistent with my experience.
QuickType Keyboard: Multilingual Typing
English, Chinese, French, German, Italian, Japanese, Spanish, Portuguese, Dutch, and Hindi