The United States fought Germany, Austria-Hungary and other members of the Central powers in World War I. America's primary enemy was Germany due to several of its actions designed to shift the war to its advantage. The main factors that contributed were the sinking of the Lusitania and the Zimmermann Telegram.
German U-Boat submarines sank a British transatlantic liner, the RMS Lusitania, on May 7, 1915. The ship was carrying 128 American passengers. Up until this point, German submarine warfare was unrestricted. After a warning from President Wilson about violating international law concerning submarine warfare, the Germans relented but proceeded to attack merchant ships that were carrying goods to the United Kingdom and other Allied nations.
The other cause for the United States' entry into World War I was the Zimmermann Telegram. This was a telegram Germany sent to Mexico, urging Mexico to become Germany's ally and attack the United States' southern border. In return, Germany promised to provide Mexico with its former territories of Arizona, New Mexico and Texas. President Wilson received the note from the United States embassy in Great Britain and made the note public. The American public and Congress then resolved to go to war against Germany.