I was thinking about these Obito - Tobi theories and came to this thing. We know that Uchihas progress their sharingan abilities while being in a intenste stress, emotional pressure or - and this is the most "powerful" way - in the near-death experience.
This is I think what happened to Obito...