The USA's entrance into WWI was primarily over the issue of unrestricted submarine warfare by the Germans. This was done purposely by the Germans, with full knowledge that it would result in a US declaration of war.
In the common practice of the day (aka: prize rules) it would have been perfectly reasonable for a beligerant to stop and board ships it suspected of supplying the enemy during a time of war. It would further have been fine for them to confiscate or (sink if not a passenger ship) any found to actually be carrying such supplies. However, they were supposed to make some kind of humane accomodation for crew and passengers.
However, Germany's fleet really couldn't match that of Great Britain and her allies on the surface. So they took to embargoing the allies using submarines (u-boats). A submarine obviously can't take on large amounts of passengers, didn't generally have room for a marine detachment required for a proper boarding action, and were quite vulnerable if they surfaced for any length of time. In short, the standard prize rules just didn't work for them.
The Germans mostly dealt with this by ignoring the prize rules. However, this was looked on by many others (including most in the USA) with horror, much like if somebody today publicly renounced the Geneva Conventions. This inevitably led to incidents, including some where American civilians were killed.
The Germans were quite aware of the American attitude on this, and for a while promised not to use the tactic purely to keep the Americans from joining the war. What changed things was the collapse of the Russians. The German high command began to think that combining an effective blocade of England via unrestricted submarine warfare with the large transfer of troops to the Western front which they were now capable of, they could win the war before the USA would have time to mobilize and join the fight in any effective numbers. The USA had a tiny army anyway, so it was possible that it might be a very long time indeed (if ever) before they could participate effectively.
Sadly for Germany, the English discovered ways to counter the increased u-boat activity (eg: the convoy system), and their new preponderance on the front was not enough in the era of trench warfare to break the stalemate. So even without the Americans, nothing effectively had changed.
Meanwhile the Americans drafted nearly 3 million men. Once they started coming over in force with fresh (effectively double-strength) units, at a rate of about 10,000 men a day, it was all over.