His 7,000 men dug in around Yorktown, creating a network of bastions, trenches, and batteries. However, he was soon trapped on the peninsula by Continental forces.
Having failed to decisively defeat Continental forces in North Carolina , Cornwallis turned north into Virginia. British strategy became confused, with Lt. Gen. Sir Henry Clinton in New York advising Cornwallis to evacuate his army from Virginia and unite forces with him in New York. Cornwallis was reluctant to give up his campaign to gain a decisive victory in Virginia but did seize Yorktown as a deep water port where he could load his troops onto transports, if necessary. Once on the peninsula, Cornwallis found himself bottled up by Continental forces and facing supply issues. “By examining the transports with care and turning out useless mouths my provisions will last at least six weeks from this day if we can preserve them from accidents,” he wrote to Lt. Gen. Sir Henry Clinton in New York in 1781. “This place is in no state of defence. If you cannot relieve me very soon you must be prepared to hear the worst.”
https://allthingsliberty.com/2020/04/what-they-saw-and-did-at-yorktowns-redoubts-9-and-10/
John Smart; Colonial Williamsburg