It's never really explained how "relics" choose which sorcerers can wield them, but the Cloak made an exceptionally fast decision about Strange. Only a few minutes after his arrival in the sanctuary, without any apparent threat to its own well-being or prompting from Strange, it went out of its way to defend him from Kaecilius. Then it served him faithfully for the rest of the movie. Mordo and the Ancient One even comment on it "accepting" him, implying that the Cloak taking such a quick liking to someone is impressive or highly unusual.
I have zero familiarity with Doctor Strange outside of this movie, but the Cloak seems to be at least as intelligent as (for lack of a better comparison) Aladdin's magic carpet, so it's conceivable it consciously chose to help Strange. Did it just really like Strange? Could it somehow tell that helping Strange was the best chance at saving the world? Was Strange "worthy"?