how MongoDB manages transactions when you need to change data in more than one place (document) at the same time, and how it keeps your data safe and correct during those changes.
This is well documented. You should start by reading. You are welcome to asked specific questions about what you read and do not understand.
Look at