Plug Your MacBook in When Charging Other Devices
If you connect your iPhone or other devices to your MacBook for charging, then you should plug in your MacBook when you’re doing it. This will not only save you battery life but also will keep your MacBook’s battery healthier in the long run.
Charging other devices with your MacBook makes its battery work much harder than it needs to, so Apple recommends that it’s plugged in at all times when using it to charge something else.