The Alaska Panhandle (the part of Alaska that extends down the west coast of BC) and the coast of BC are actually roughly equal length (BC's coast is slightly longer, I believe). You are probably looking at a Mercator projection which distorts sizes. Try looking at a more accurate map projection.
It exists cause Russia settled Alaska including a fort in the panhandle. There was treaty with British in 1825 that established the boundary of panhandle (but was very ambiguous for landward side). Russia then sold Alaska to the US in 1867. The landward boundary had to be decided in 1903.
There's no road along the coast, just isolated port towns, and there's a massive barrier of mountains and glaciers between it and BC, so on a human scale it's essentially not related to mainland Canada.
American politicians and capitalists realized how valuable the western half of the continent before British Canada did and they acted on it. If you look as the west coast it’s mostly American coast, it’s kind of surprising that Americans didn’t just take it all when you think about it
They did. The US’ Oregon Territory went well above the 49th parallel (current US/Canada border on the West coast), in fact all the way to where Alaska is today (southern most point on the coast).