MEXICO CITY — The Trump administration calls the visit a step toward mutual understanding, a way to move the relationship forward.

But as Secretary of State Rex W. Tillerson arrived in Mexico on Wednesday, twin threats hung over the frayed relationship between the two nations: President Trump’s new orders to round up and deport immigrants who are in the United States illegally, and a separate effort to take a hard look at all American aid to Mexico, possibly using it to pay for a border wall instead.

By Friday, American officials are required to finish calculating all the money and grants that the United States provides to Mexico, a task that Mr. Trump first demanded in the executive order he signed last month directing the construction of a border wall.

The Trump administration, which set the Friday deadline in an internal State Department memo this month, has not explicitly said why it ordered the review. But its inclusion in the executive order mandating that a wall be built suggests that Mr. Trump has linked the two issues — and may be looking for more leverage in negotiations with Mexico.