Reliquary System in Nier: Automata is the system for what happens when you die in combat.
When your character dies, its body remains on the map as a corpse. These bodies contain various data, so you'll have to go back to your body to retrieve your belongings.
If you die again before reaching your previous body, it will disappear. If you keep playing for an extended period of time without retrieving your body, it will disappear.
When you make it back to your body, you also have the option to repair it. If successful it will join you for a time in support. If you fail it may become hostile and you will have to defeat it.
Retrieving your body allows you to recover your Plug-In Chips and restore your previous setup.
Adding in the asynchronous twist, you leave a message and your body behind when you die for other players to find, and they may pray for you and heal you, obtain your gear in their worlds, and repair your broken body to have as a helper to their work. This means that if you are playing online you may find corpses of other players mid-battle, and be able to heal yourself and summon the body of that player to help you with the boss at that very moment.
After a specific point in the game, the Reliquary System will be inactive and all deaths will lead to a standard game over where the player will be forced to start from their most recent saved game.