I am loading data from a file. MySQL doesn't seem to insert line by line. So how does mysql load the data. Does it do one big chunk at the end after reading the file? Reading a file with 50000 rows.
If the table is InnoDB, each statement is executed as a transaction unless you start a transaction explicitly. So it's as if you'd written:
START TRANSACTION;
LOAD DATA INFILE ...;
COMMIT;
So the result of loading the file is made visible atomically.
See the documentation on autocommit mode.