Was the audio unmuted last time the headphones were unplugged? I don't have any apple hardware but this is a common feature of Android. Your laptop might remember the state "speakers are on but headphones are muted". So when you remove headphones, it switches to the speakers and starts playing.