If no errors occur, each batch is based on the one produced just before it (a batch starts from the first transaction not included in the previous batch and is based on the state the previous batch transits to). This results (normally) in a chain of batches. In case one of the batches fails to update the StarkEx smart contract's state (e.g., is reverted on-chain), the issue is automatically detected, and the following batches are based on the last valid batch.