2 pass will encode a file once, and store a log of information about what it did… then on the 2nd pass it’ll use that information to better know when it should use more or less bitrate/keyframes - honestly i’m not too sure of the specifics here
now, it’s most often used to keep a file to a particular file size rather than increasing quality per se, but id say keeping a file to a particular size means you’re using the space that you have effectively
looks like with ffmpeg you do need to run it twice - there’s a log option
i mostly export from davinci resolve so i’m not too well versed in ffmpeg flags etc
doing a little more reading it seems the consensus is that spending more time on encoding (ie a higher preset) will likely give a better outcome than 2 pass unless you REALLY care about file size (like the file MUST be less than, but as close to 100mb)
this is literally the exact kind of thing that chatgpt hallucinates. it’s not only not trustworthy, i’d bet on it being wrong