How did Idaho get its shape?

Through the establishment of other territories and states.
1846 - Treaty with Great Britain established Pacific Northwest as part of the US.
1848, Aug. 14 - Oregon Territory was established which included Idaho, Washington and parts of Montana and Wyoming.
1853 Washington Territory established to include Northern Idaho and part of Montana.
1853 Oregon Territory now included Southern Idaho, and part of Wyoming.
1859, Feb. 14 - Oregon becomes a State (present Oregon boundaries). The southern portion of Idaho (and part of Wyoming) now is in the Washington Territory.
1863, March 4 - Idaho Territory is split off from Washington Territory. Portions of Idaho are in present day states of Wyoming and Montana.
1864, May 28 - Present day Montana Territory is established by splitting away from Idaho.
1868, July 25 - Present day Wyoming Territory is established by splitting away from Idaho.
Present day boundaries now exist.