Throughout the Revolutionary War, Britain always thought without a doubt that they would win the war. They were fighting against a small militia that were inexperienced. Therefore, their minds never thought that they would get trapped.
Instead, at the last battle, the Americans were able to surround the British at Yorktown which is on the coast. Cornwallis was in charge of the British army and he was pushed to the coast. The American navy and the French navy kept the British from leaving by sea.
The Continental Army fought it from the land. Therefore, the siege finally ended the war. Cornwallis had to surrender because no one could break through the Continental Army and the navies that were in the water.