With the French army all but destroyed the government of France came to the unavoidable conclusion that it could not continue the war. On 22 June the French sought an armistice with Germany. Hitler agreed to the proposal and chose Compiègne as the location to negotiate the terms.
Hitler deliberate chose Compiègne as it was the site where the Armistice was signed in 1918 ending the First World War. Furthermore Hitler also decided that the negotiations were to take place in the very same railway carriage, located at exactly the same spot, that the 1918 negotiations took place; it was Hitler's idea of revenge. Hitler even deliberately left the carriage after the preamble, as had French Marshall Foch in 1918, leaving General Wilhelm Keitel, the Chief of the German High Command to complete the negotiations.
Hitler chose to agree to an armistice for several reasons:
Under the terms of the armistice France was to be divided into two zones both of which were administered by a French government based in Vichy: a northern zone, that included the whole of France's western coast, would be occupied by Germany and a southern zone that remained relatively free of German influence. All French prisoners of war, around one and a half million of them, were to remain prisoners. The terms of the armistice were to be applied until cessation of hostilities with Britain, at which time a peace treaty would be agreed. None of the French delegates believed the war with Britain would last long and so they agreed to the terms. The Armistice went into effect just after midnight on the morning of 25 June 1940.