Not 100% sure but I think in things like the ISDE you get a set maintenance time. Some of the riders do what I would consider huge jobs, top ends, clutches etc in really short times, I'm amazed.
Heard about joel smets ( MX rider) competing in an enduro, due to moose (mousse?) inserts, he had a lot of trouble changing his tyre/s during a rider only maintenance session at the end of the day. Whilst everyone was sleeping, he was practicing his tyre change, next morning, during a short maintenance session, he changed them no problem, and had time for a filter change or something similiar.
Saw an A grader from our club at an event ( not riding, injured ) hang around the pits, people would come in with flats and he'd just jump on em and get into it, 10 mins later they're on their way, that was after finding tools etc.
I'm going to take my wheel off next time I need a tyre, and spend the afternoon just putting it on and taking it back off, nothing beats practice.