Okay, so I was watching my friend battle a trainer when he suddenly threw a master ball and catched the trainer's Pokemon! I thought we can't catch trainers' Pokemon!
By hacking. Nuffsaid.