How it works
The CSV is read one character at a time rather than split on line breaks, because a quoted field may contain the delimiter, a doubled quote standing for a literal quote, or a line break, and all three must stay inside the field. A quote opens quoted mode only at the start of a field, so a value such as 5'10" inside an unquoted cell is taken as text. Unquoted fields are trimmed, quoted ones are kept exactly, blank lines are skipped, a Windows carriage return is dropped, and the UTF-8 byte-order mark Excel writes is removed so it does not end up inside the first header.
With Auto-detect the delimiter is whichever of comma, semicolon, tab and pipe appears most often in the first non-empty line, the first of those on a tie. With First row is header ticked, each later row becomes an object keyed by the header names: a short row is padded with empty strings, extra cells go into a __parsed_extra array, and a warning is listed for every row whose cell count differs from the header. Every cell is a string unless Detect numbers, booleans and null is ticked, which converts 42, -3.5, 1e3, true, false and null while keeping leading zeros and integers past 2^53 as text.
Going back, a JSON array of objects is written with a header made from the union of every object’s keys, in the order they are first seen, so a field that appears only in the third object still gets its own column and a missing value is an empty cell. An array of arrays is written row by row. A cell is quoted when it contains the delimiter, the quote character, a line break or leading or trailing whitespace, with any quote inside it doubled, and a nested object or array is written as its JSON text.