Once a harsh critic of Donald Trump, the South Carolina senator became one of the President’s most dependable allies—a sign of what it takes to remain influential in today’s Republican Party.