Every time I use my Apple Macbook Pro M1 the brightness is automatically changed. It becomes very dimmed when I use the Macbook while on battery power.
Found the solution in Apple forum and put the steps in screenshots for easy for troubleshooting for other Macbooks users.
1) Go to battery preferences

2) If your Slightly dim the display while on battery power is checked, please uncheck it.

