It all starts with the Treaty of Paris, the treaty that ended the American Revolution and defined the boundaries of the United States. That treaty set the border of the United States in the area of the Northwest Angle as such:
Thence through the middle of said Long Lake and the Water Communication between it & the Lake of the Woods, to the said Lake of the Woods; Thence through the said Lake to the most Northwestern Point thereof, and from thence on a due West Course to the river MississippiRight up to the "Northwestern Point" part, it describes the current border. The problem is (for anyone who knows their geography) is that the Mississippi River doesn't go that far north. So, you can go west forever from the Northwester Point of the Lake of the Woods without coming to it. The reason for this mix up is that in 1783 no one really knew the geography of that area very well, and so no one knew where the Mississippi River was.
By 1794, people began to become aware of this problem. So when the Jay Treaty was signed that year they addressed it.
Whereas it is uncertain whether the River Mississippi extends so far to the Northward as to be intersected by a Line to be drawn due West from the Lake of the woods in the manner mentioned in the Treaty of Peace between His Majesty and the United States, it is agreed, that measures shall be taken in Concert between His Majesty's Government in America, and the Government of the United States, for making a joint Survey of the said River, from one Degree of Latitude below the falls of St Anthony to the principal Source or Sources of the said River, and also of the parts adjacent thereto, And that if on the result of such Survey it should appear that the said River would not be intersected by such a Line as is above mentioned; The two Parties will thereupon proceed by amicable negotiation to regulate the Boundary Line in that quarter as well as all other Points to be adjusted between the said Parties, according to Justice and mutual Convenience, and in Conformity, to the Intent of the said Treaty.So, they punted. By 1803, Great Britain was able to prove that the Mississippi did not go north far enough and the United States was preparing to draw the line south from the Point to the Mississippi River. But then they bought Louisiana and the whole border debate had to be reopened, since the location of the Mississippi River was somewhat moot.
Even when the location of the Mississippi River was determined, there was another problem. Nobody knew where the Northwestern Point of the Lake of the Woods was, but they figured it was somewhere near the 49th parallel. In 1807, negotiations were heading towards setting the 49th as the border, but other issues got in the way of an agreement. And then there was a war. So at the end of the War of 1812 in the Treaty of Ghent, both sides decided to appoint some Commissioners to deal with it.
The said Commissioners shall by a Report or declaration under their hands and seals, designate the boundary aforesaid, state their decision on the points thus referred to them, and particularize the Latitude and Longitude of the most North Western point of the Lake of the Woods, and of such other parts of the said boundary as they may deem proper.Now at Ghent, the British had tried to push the boundary way south claiming, rightfully, that the area west of the Ohio River was mostly populated by Canadians. But the US resisted such efforts. There was also a problem from the 1783 Treaty that referred to something called "Long Lake." No one knew what that was. So it was still a mess.
By 1818, there was still no one who knew where the North Western point of the Lake of the Woods was or what Long Lake was and people were starting to settle the area of the border west of there. They needed to know if they were in Canada or the United States. So, this is where they decided to gamble. At the Convention of 1818 they signed another treaty, one which defined the current border, sort of
It is agreed that a Line drawn from the most North Western Point of the Lake of the Woods, along the forty Ninth Parallel of North Latitude, or, if the said Point shall not be in the Forty Ninth Parallel of North Latitude, then that a Line drawn from the said Point due North or South as the Case may be, until the said Line shall intersect the said Parallel of North Latitude, and from the Point of such Intersection due West along and with the said Parallel shall be the Line of Demarcation between the Territories of the United States, and those of His Britannic Majesty, and that the said Line shall form the Northern Boundary of the said Territories of the United States, and the Southern Boundary of the Territories of His Britannic Majesty, from the Lake of the Woods to the Stony Mountains.I say sort of because no one knew whether the 49th Parallel was north or south of the Point. Instead of continuing the line west of the Point, which had been the original border, the US agreed to go to the 49th parallel. And then in the Treaty of Oregon in 1844, the border was extended from the Rocky Mountains (or Stony Mountains) to the Straits of Georgia.
7 years after the border was set, British astronomer Dr. Johann Tiarks determined where the Northwest Point was. It was about 26.58 miles north of the 49th Parallel. If the US had continued to insist that the border go due west from the point, then the US would have gained a territory pushing 26.6 miles north running for 1269.5 miles. That's an area of 33,744 square miles, which is larger than the state of South Carolina. Among other things, this would mean that the entire city of Vancouver, British Columbia, would actually be in Washington state.