Surges of migrants have shaped President Biden’s policies at the border in ways that few of his allies imagined when he was running for president.