The "switch" that is flipped is the scanning of your boarding pass at the gate.
.
.
I'm not sure scanning the boarding pass triggers the earned miles.
I recently boarded an AA flight that subsequently pulled away from the gate and then returned before taking off because of a mechanical failure.
I believe you both are right. Scanning the boarding pass is the beginning of the process. That links you to the flight. If I remember right the GA then has to "clear" the flight.
Why it takes three days to post to our accounts is another story. Delta miles are posted the same day from what I hear. Now that's using technology right.