While the media 100% did play a role, and it was a big one, we can't ignore the benefit of moving in silence. Obama offered a vague vision of change. people forget he was a populist candidate that started off as a seemingly grassroots movement. he had to get Biden and Hillary out of the way in the 2008 primary, and he did with brutal effectiveness, while also bringing both into his regime in top roles.
Obama didnt scream from the mountain top what he was going to do specifically outside of a few things like get out of iraq and no new major deployments of troops. and healthcare change.
the most effective presidents of our lifetime have done most of the major things they did without screaming about it during the campaign. prime change, dont promise specifics. thats been trumps downfall. he basically told the media what to look out for while bragging they cant stop him, and they have.
Trump used it as a key issue to get elected on but even before that the narrative of him hating Mexicans, 'kids in cages', AOC photoshoot, etc. was set in motion. There was a notable shift within the Democratic party and subsequently you had widespread MSM partisan coverage of immigration.
Sure Trump played his part in stoking the division but lets not pretend there wasn't a huge and organized opposition to him on immigration even before that.
Thousands didn't take to the streets in the dead of winter to block ICE enforcement in such a brazen way under Obama. There was some level of cooperation between fed and states/munis on the coordination and enforcement. Now non cooperation is touted as some great moral high ground, while criminal harassment of federal officers is lionized.