Hoffmann assimilated well with Polish society; the years spent in Prussian Poland he recognized as the happiest of his life. In Warsaw he found the same atmosphere he had enjoyed in Berlin, renewing his friendship with Zacharias Werner, and meeting his future biographer, a neighbour and fellow jurist called Julius Eduard Itzig (who changed his name to Hitzig after his baptism). Itzig had been a member of the Berlin literary group called the Nordstern, and he gave Hoffmann the works of Novalis, Ludwig Tieck, Achim von Arnim, Clemens Brentano, Gotthilf Heinrich von Schubert, Carlo Gozzi, and Calderon. These relatively late introductions marked his work profoundly. He moved in the circles of August Wilhelm Schlegel, Adelbert von Chamisso, Friedrich de la Motte Fouque, Rahel Levin, and David Ferdinand Koreff. His fortunate position was not to last: on 28 November 1806, during the War of the Fourth Coalition, Napoleon Bonaparte's troops captured Warsaw, and the Prussian bureaucrats lost their jobs. They divided the contents of the treasury between them and fled. In January 1807 his wife and two-year-old daughter Cacilia returned to Posen, while he pondered whether to move to Vienna or go back to Berlin. A delay of six months was caused by severe illness. Eventually the French authorities demanded that all former officials swear allegiance or leave the country. As they refused to grant him a passport to Vienna, he was forced to return to Berlin. He visited his family in Posen before arriving in Berlin on 18 June 1807, hoping to further his career there as an artist and writer.

Answer this question "Why" by extracting the answer from the text above.
Napoleon Bonaparte's troops captured Warsaw, and the Prussian bureaucrats lost their jobs. They divided the contents of the treasury between them and fled.