It doesn't happen every time. The last time I connected my iPhone to my MacBook Air was last week, and everything was fine.
Sometimes my MacBook Air shuts down when I connect my iPhone to it. What should I do about this?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
The Macbook Air tries to supply a full charging current to the iPhone, but when the Air is running on battery and doesn't have a full charge, it loads the battery down enough for the Air to go into low power mode.
When you connect you iPhone, make sure you have a full battery on the Air, or are plugged in. This will also happen less frequently if the iPhone battery is full, but the main issue is making sure the Air has enough power to give a full amp to the iPhone without shutting down.
This doesn't affect the larger notebooks as noticeably due to their larger battery packs, but as they age and when they have low charge you would see the same issue from them.