When a user submits, the form runs a defined sequence before it reports success:
The form assembles a nested record tree from the answers: the context record at the root, parent records above it, and child records below it. Values are coerced to the right type for each field, for example dates and times to the correct format and multi selects joined appropriately.
The tree is saved in order: parent records first, so their ids can be linked into the context record; then the context record; then each child record linked back to the context record. As each record saves, its id is stamped back into the form data, so a later resubmission updates the same records instead of creating duplicates. See Context, parent and child objects.
The most important behaviour for admins to understand is that Salesforce side failures are surfaced inline on the form, on the exact field that caused them where possible. This covers three common sources of failure:
Where the offending field is on the form, the error appears against that field or against the specific child row or parent panel. Where the offending field is not on the form, the error appears as a form level message so the user still sees why the submission failed. In all cases the user stays on the form and can correct and retry.
If a submission errors, the response record is marked failed and records the error message and error type. The error type distinguishes a database side failure from a client side one. This gives administrators an audit trail of failed submissions with the reason.
The generic save path reports per record results, so a submission that partially fails returns which records had errors rather than silently dropping them. Those per record errors are what get mapped back onto the form fields.