Polk avoided war with the British by agreeing to settle on a border along the 49th parallel (the northern border of Washington state), across the Rockies to the Pacific instead of rallying round the "54'40' or fight!" motto of his presidential campaign, which referred to a border as far north as the 54th parallel (in present-day Canada).
Polk's expansionist ambitions held great appeal when many Americans thought it their right and destiny to occupy as much land as possible on the North American continent. Also driving the acquisition of Oregon, though, was the need to balance Texas as a slave state with a free state in the north.