Trump's authority to levy tariffs unilaterally is derived from the Trade Expansion Act
The legal basis cited in Trump's tariff order is Section 232 of the Trade Expansion Act of 1962 which under certain circumstances allows the president to impose tariffs based on the recommendation from the U.S. Secretary of Commerce if
an article is being imported into the United States in such quantities or under such circumstances as to threaten or impair the national security.
This section is rarely used, and has never been invoked since the World Trade Organization was established in 1995.
Prior to Trump, there had only been Section 232 investigations launched. No prior President has ever invoked it to create a tariff.
Since 1980, the Department of Commerce has conducted fourteen Section 232 investigations.
It's unlikely anyone who passed the original act envisioned a President declaring trade a "threat to national security" merely as a way to impose tariffs as a negotiating tactic. The provision goes back to the creation of the World Trade Organization
[S]ome 70 years ago—in 1947—23 nations signed the General Agreement on Tariffs and Trade (GATT), which in 1995 became The World Trade Organization, now with a roster of 163 countries. With the rest of the world’s major economies reeling from the destruction of WWII, American participation in GATT was both an act of generosity and of self-interest: We needed a recovered world with which to trade.
To get agreement on GATT, the drafters had to include an escape clause: If imports threaten national security, the importing country can levy super-high tariffs on those products. In the United States, Section 232 of the deceptively named Trade Expansion Act of 1962 allows the president to initiate an investigation to determine whether our security is indeed threatened by imports, which threat can include “substantial unemployment … decrease in government revenue … displacement of any domestic products by excessive imports,” among other impacts. This broad definition of a threat makes the policy options virtually unlimited.