Would using an iPad as a second monitor be harmful to its battery life?
The battery will wear faster when you use power-hungry applications or set the display very bright very often. Duet may be such an application.
You may not notice it, but the battery transfers much more energy in the same amount of time. This leads to more 'battery cycles' which in turn degrade your battery.
It has no negative impact on the battery life if you keep the Lightning cable in plugged in all the time.
However, use the original 12 Watt USB power adapter and a certified Lightning cable for your safety, especially if you leave the iPad unattended.
General tips to increase your iPad's battery life
- Keep the device cool. Remove unneccessary cases and don't place it near warm objects.
- Use certified Lightning cables. This is for your safety. You don't need to expensive cables made by Apple, as long as they are certified. They are called MFi which stands for "Made for iPhone/iPod/iPad". MFi cables undergo electrical and mechanical tests by Apple.
- Use original power adapters. Again, you don't want the power adapter to catch fire. It's fine to connect the charging cable to your computer's USB port instead.
- If your iPad will be unused for some days, discharge the battery to ~50 %. "(…) if you store it fully charged for an extended period of time, the battery may lose some capacity, leading to shorter battery life."
Terminology
Battery cycles
When you use your [device], its battery goes through charge cycles. A charge cycle happens when you use all of the battery’s power—but that doesn’t necessarily mean a single charge.
For example, you could use half of your notebook's charge in one day, and then recharge it fully. If you did the same thing the next day, it would count as one charge cycle, not two.
Source: Apple, emphasis mine
Battery wear/degradation/condition/health
The more you use a battery the more its capacity will reduce over time. This is sometimes called 'battery wear'.
Battery degradation can have different causes. Using a device so often that you need to re-charge it daily from 0 to 100 % will lead to a high battery cycle count. The chemicals in the battery will store less energy after each cycle.
The battery condition can give you a hint how much of its original capacity a battery can hold. It may be ok for a battery to retain about 80 % of its original capacity after 1000 full cycles. If you have a new device with the same low battery condition (80 % capacity) something may be wrong with your battery. This can be caused by faulty battery or a few cells within your battery that are not working. Battery condition is sometimes called battery health.
It shouldn't affect the battery life of your iPad unless you keep it plugged in forever (for a very long amount of time, which you shouldn't). This is like plugging in your iPad for the whole night. It will stop charging itself when it is full and simply just be running on the power adapter. Unless you decided to leave it in forever (the problem with this is that it will always be using the lightning cable to draw power and the battery is hardly even used) otherwise it shouldn't be a big problem to worry about. You also don't have to worry about battery draining while using the iPad by plugging into your MacBook as your MacBook will provide extra energy enough for the iPad to charge and be running on the Lightning Cable.
If you want to learn more about how charging works on iPhone (should be the same for iPad) there is another question here that give some detailed information on how iPhone/iPad charges.
It will only be bad for the battery life if the battery actually discharges. If the power provided by the host device is enough to drive the tablet, the battery should never be discharged.
Given that the display of any large tablet is very power hungry, and USB ports of many laptops deliver very little power, I suggest to try it out while the tablet is at around 50%, and check if the battery is higher than 50% after an hour or so. If it is noticeably higher than 50%, you're fine. The answer will be different for different laptops, and might even depend on the laptop being plugged in or on battery.
iOS devices are designed with intelligent battery management software (as part of iOS) that ensures leaving them plugged in, even during use, is not bad for the battery.
In particular, when the device is nearly 100% charged, it goes through charge/discharge cycles that are beneficial for battery life in the long run. You can read about that for example in this older article about iPad batteries.
Li-ion batteries are not Ni-Cad batteries, which needed full discharges to keep from having a 'memory' effect. Li-ion batteries are most healthy when not quite fully charged, but much worse for them is being fully discharged; and an Li-ion battery that is kept fully charged all the time isn't particularly bad for it (it's the act of charging from very discharged to fully charged that's a bit bad for it).