Many Mac owners leave their computers plugged in most of the time, or leave them in "desktop" mode constantly.
In general, both processes are safe, but they may affect the performance of the device, and they may have some bad results.
Over time, the two mentioned processes may slow down the performance, and it is generally recommended to restart your MacBook, because some programs can have memory leaks that lead to problems.
RAM errors called "single-bit errors" can also creep in when your machine doesn't restart, and a large percentage of these errors occur when single bits build up by ionizing radiation from electrical sources over time. Restarting generally alleviates these issues.
Disadvantages of leaving the computer plugged in
The materials that batteries are made of are chemicals that wear out over time, and factors such as the number of charge cycles and temperature can degrade battery efficiency, and leaving your MacBook plugged in and 100% charged continuously can reduce charging capacity or drain the battery in the long run. .
It is recommended that you keep your device battery charged at 100% for a very long time, especially if you are running high-quality applications such as graphic applications and games or applications that are very CPU intensive.
Here comes the importance of the Optimize Battery Charging feature provided by the manufacturer of the MacBook (Apple). It is the mechanism, which delays charging up to 80% when your device is constantly connected.
This feature monitors your operating habits and stops charging when it is not necessary, knows when to unplug your MacBook and timing the charging cycle to keep it at 80% and when you need to charge it to 100% it will automatically activate the option.
There is no way to directly control the battery optimization feature other than the on/off switch.
Apple also recommends constantly updating software, unplugging devices when not in use, and adjusting Energy Saver settings to maximize battery performance.