The point of taking care of batteries is to make them last more than 2 years before replacement. Abused batteries barely last a year. If you replace your phone every 2 years, it's not a big deal at all.
Anyway the gist is, basically, batteries work by ion movement, and like a machine, these ions wear out over time due to use. And similar to machines, heavy use wears them out more. You're more likely to break an engine by running it for 1 day at max rev, than running it over a month at half capacity. The smaller the depth of discharge, the lower the wear. Lab tests have concluded that when you constantly discharge from 100 to 0, it allows you betwrrn 300-500 charge cycles before it starts to break down and not hold charges. More specifically, when you reach that magic number your battery can only hold 75% of it's original charge. That's typically 1-2 years of use if you charge once a day. And heavy abusers charge more than once a day, so that decreases the time span to however many weeks it takes them to reach 500 charge cycles. Now, the increase in charge cycles is exponential, not arithmetical. So a depth of discharge to 50 before recharging will not give you 600-1000 charges. Rather it will give you 1200-1500 charge cycles. Mathematically, draining a 3600mah to zero for 300 charges gives you 1080000mah to burn through however short your battery life will be. On the other hand, using only 50% of the battery before recharging gives you 2160000mah to burn through before it expires after at least 1200 charge cycles. In other words, it stored twice more power for you to use. If you say, charge once every 24hrs, going always from 100 to 0 gives you at least 300 days. Recharging twice a day at 50% gives your battery at least 600 days of use before battery capacity deteriorates noticeably. Discharging to 75% before recharging actually gives you 2000-2500 charge cycles, making it even longer. Basically the point is, always plug the phone in when given the chance. Don't wait for 50%, or whatever. 40% is an arbitrary number actually, not sure why it's chosen. Also, this is why one of the choices to auto activate power saving in the S7 is at 50%, so that it keeps the battery up as close to 50% as possible when you get the chance to plug in.
*
As for charging to 80%, this is because partial charge is better than full charge for lithium ion batteries. The ions are placed on stress to hold charges. Maximum stress is at 100% charge. And like everything else, stuff tends to break more. So not running it to 100% all the time will reduce overall stress experienced and increase the time before deterioration occurs. Personally I charge to 90%, and discharge to 40% or above. I set Lightflow to sound an alarm and turn the charging LED to green once the phone hits 90% charged. That's a 50% depth of charge, so that's good for up to 1500 charge cycles, plus whatever number of cycles the decrease in max stress gives me.
However, note that environmental temperatures also play a role in battery longevity.