It uses two side-by-side minipages to put the example code and output adjacently. Internally, \VerbatimOut is used to store the example code, verbatim, in a temporary file which is then passed to minted for pretty-printing (left side) and \inputted directly for typesetting (on the right side).