President Trump’s abrupt increase in tariffs on Turkey, aggravating an economic crisis in the country that spilled into global financial markets on Friday, appeared to be a response to Turkey’s refusal to release an American pastor. But the escalation also reflected a litany of deep-seated grievances between the United States and Turkey that threatens relations between the two NATO allies.

Those grievances, analysts said, have been amplified by Mr. Trump and his Turkish counterpart, President Recep Tayyip Erdogan, both strong-willed leaders who share a penchant for invective and doubling down when threatened.

“You have all the ingredients for a catastrophe,” said Marc Pierini, a former European Union diplomat to Turkey who is now a visiting scholar at Carnegie Europe.

Sinan Ciddi, executive director of the Institute of Turkish Studies in Washington, said Mr. Erdogan and Mr. Trump were headed toward the “rabbit hole in Alice in Wonderland.”