The Idaho Oregon border mostly makes sense to me with the Snake River presenting a natural geographic boundary & it's southern border as I understand it conforms to the former northern border of Mexico but I'm curious about its long eastern boundary. Western Montana & a sizeable chunk of Western Wyoming both were originally a part of Idaho why'd they get lopped off & added to other territories? Also why did North Idaho become a part of Idaho rather than Washington?
Okay, let's start at Idaho's northwestern corner and work our way clockwise.
The northern border is straightforward -- it's just the 49th parallel, same as all the other states west of Lake of the Woods, MN.
For the upper eastern border (the right side of the panhandle), this is a weird one. Without getting into too much detail, a former Ohio congressman named Sidney Edgerton was sent to Idaho on a judicial appointment, and he wasn't especially happy about being assigned to a backwater area. At the time, Idaho and Montana were still one territory. When Idaho and Montana proposed a division, Idaho's residents chose Edgerton to represent them in the negotiations. That northeastern bit let Idaho keep the agricultural land in the Kootenai River watershed, which would have been hard for Montana to access anyway.
Next, the squiggly bit of the eastern border follows the crest of the Bitterroot Mountains (it would have been the Continental Divide, but Edgerton pushed to have it further east, and apparently a hefty bribe in gold helped seal the deal). The lower segment of the eastern border goes straight south along 111 degrees W., for two reasons. First, it let Idaho keep that nice fertile swath of land in the Snake River valley, which gave an agricultural resource to an otherwise very mountainous state. The other reason is that it defined the western border of Wyoming in a way that gave Wyoming 7 degrees of width. Acts of Congress had defined several states with 7 degrees of width (North Dakota, South Dakota, Colorado, Washington, and Oregon) in an effort to have some equality in the state sizes. Obviously, this succeeded in some states more than others, but this is why our western states tend to be similarly-sized.
Idaho's southern border is the 42nd parallel, established early on when England and Spain were contesting their land claims and needed to come to an agreement somewhere.
The western border has three segments. First, when Oregon was becoming a state and releasing their eastern territorial regions, they defined their eastern border as the path of Snake River, going south until the confluence of the Owyhee River, at which point the border just goes due south. This covers Idaho's western squiggly bit and its lower straight line. Idaho was still part of the Washington Territory at this point, but four years later, Washington did the same thing and defined their eastern border as the path of the Snake River up to the confluence of the Clearwater River, and then straight north (neatly dividing the towns of Lewiston, ID and Clarkston, WA to this day). The reason Washington wanted to lop it off there is that most of the state governance was happening in the Puget Sound region, and Idaho was getting a sudden influx of miners into its northern mountain regions. Having to govern a bunch of state newcomers at such a far distance, especially with all their cultural and political differences (many of which are still in place today) just wasn't feasible, so the territory was divided there. Issues with governing far-outlying populations have actually influenced a lot of state borders in interesting ways.
Source: How the States Got Their Shapes by Mark Stein (2008), a really fascinating book if you enjoy geography even the tiniest bit. It's also great if you want to learn more about some of the big border decisions affecting multiple states I did not elaborate on here (like why IS that northern border at the 49th parallel?).