Macbook laptop would dim the display while it is running on battery power. But if you want to prevent this behaviour then you can change the settings using System Preferences.
Steps to prevent dim display
Step 1: Click Apple icon and select System Preferences from the list.
Step 2: In the System Preferences screen, navigate to Hardware section and click Energy Saver option.
Step 3: Click the Battery tab under Energy Saver screen, deselect the check box with caption as “Slightly dim the display while on battery power”.
Now you will not notice the dim display behaviour in your Macbook laptop. If you going to be using battery power for too long then it is better to have the checkbox selected so that your laptop does not run of battery.