How does HDFS write work?

Ever wondered what happens behind the scenes when a client writes data into HDFS?