The biggest factor contributing to Woodrow Wilson's election in 1912 was the emergence of Theodore Roosevelt's Progressive, or "Bull Moose" Party. This is a classic example of a so-called "bolter" party, in that Roosevelt left the Republican Party (and its incumbent/Roosevelt's successor, President William Howard Taft) and took many of its more Progressive members with him. Roosevelt believed that Taft had abandoned most of his Progressive reforms. So the Republican vote was divided among Taft and Roosevelt.
The key issue of the election was a difference between Roosevelt and Wilson over the proper role of government, especially in regulating monopolies. Both men and their supporters were Progressive in their beliefs, but Roosevelt's "New Nationalism" called for regulating the trusts through expanding the role of the federal government while Wilson's "New Freedom" was based on the idea that by breaking up monopolies, the government could actually remain minimal in size. When the election returns were in, Wilson received just under 6.3 million votes while Roosevelt got 4.1 million. Taft, on the other hand, got around 3.5 million, and Eugene Debs, the Socialist candidate, won just over 900,000. Wilson won 435 electoral votes, which gave him a comfortable margin of victory. But had the Republican vote been united, they likely would have won several states that Wilson otherwise took.