Lesson 4 of Practical Compositing in Nuke takes a deep dive into using merge operations and the math behind them.
For the complete lesson, go to https://learn.foundry.com/course/4685/view/merging
For the full course, go to https://learn.foundry.com/nuke#practical-compositing-with-austin-meyers
For Nuke product information, go to: https://www.foundry.com/products/nuke