Final answer:
The United States entered the war in its last years due to the sinking of American merchant ships by Germany. There was no secret alliance or economic motive behind the decision.
Step-by-step explanation:
The United States entered the war in its last years after remaining neutral at the outset due to the German naval policy of sinking American merchant ships bound for Europe, notably the sinking of the Lusitania in 1915. This act of aggression by Germany outraged the American public and increased support for the US to join the war. The sinking of American ships and the loss of American lives pushed the US government to abandon its policy of neutrality and declare war on Germany in 1917.
It is important to note that the United States did not have a secret alliance with either Great Britain or Germany at the time and there was no direct benefit to the US military industry and economy for entering the war.
Learn more about Reasons for United States entering the war