Pay in USD or the country’s currency?

I’m from the US. Whenever I travel abroad, a lot of the times I get asked if I want to pay in USD or the country’s currency. Which one is better? Does it depend on the exchange rate? Or am I missing anything?