Here are the three modes visually demonstrated for clarity...
Because of the inferiority of the missile's own radar system compared to the parent aircraft, the 'active' capable missile must still have some kind of guidance towards the target. The parent aircraft's necessary attention span on the target depends on how quickly the pilot orient himself on the target. The sooner he does so, the sooner the missile's own radar can acquire the target and the more secured that acquisition. So assuming we have an 'active' capable missile, the 'semi-active' stage must still be passed through before the missile can take over its own target resolution.
Now...If the target engages ECM, then that ECM transmission falls under 'passive'. In other words, that ECM transmission become a part of target characteristics, just like IR emissions anywhere on target body. The missile, if so capable, will switch to 'home-on-jam' mode. If the missile is equipped with an IR sensor, then we just have more target characteristics to correlate among the sensors and modes. Keep in mind that there is nothing preventing the parent aircraft from maintaining radar attention on the target even after the missile engaged its own. A less capable missile could be confused by the multiple data but that is no longer the case today.
Technology plays an important part in this but that is for another discussion, suffice to say that the superior technology will shorten the time in stage and the transition time between stages.