As for Obama / Trump, this may well be another case where the particulars turn views in different directions. How much was Obama's success at turning away people just over the border vs establish hard working people? Who knows. Anyway I dont speak for the accused hypocrites. Maybe a few are here and can chime in.
I think Obama being president sort of "masked" certain disgruntlements in certain communities that would've come to the forefront much earlier had the democratic president during that tenure been another old white guy.
If you look at the polling data among Black American voters.
The majority support maintaining the number of immigrants we have in the country via tighter border controls
Over 70% believe some should be deported
19% believe that
all illegal immigrants should be deported
Strong support for "social integration" requirements (meaning, they want the people who come in to make some sort of effort to assimilate)
And there was an interesting piece written by John McWhorter (and I'll see if I can dig it up again), but he elaborated on how democrats making a huge fuss over making sure illegal immigrants get certain accommodations/considerations starting around 2010-2012 was a slap in the face to a lot of impoverished black communities (and other minority communities who are actual citizens) who've been wanting those things from Democrats for decades and gotten nothing more that lip service, but it wasn't quite as "noticed", because people were happy with the milestone of having a president who was a person of color.
Some of the things he cited was the fact that it's long been a grievance in the Black and (legal) Latino communities that they're disproportionately more likely to serve time for non-violent offenses which leads to families getting separated. And apart from some rhetoric, not a lot was done.
Yet, when it was happening to undocumented people at the border, a bunch of Democrats raced down there to cry out in front of the detention facility for a photo-op.
Democratic governors signing bills to give education and healthcare to undocumented people
Democratic mayors offering to make their cities "sanctuaries" to help undocumented people avoid apprehension, and putting them up in $400/night hotel rooms to boot.
McWhorter asserted in the piece that things like that explain some of the "surprising" increases Trump saw among certain minority voters (but that it wasn't actually so "surprising" when you consider the backdrop and different variables at play between the Obama presidency and the Trump presidency)
I believe how McWhorter worded it in a televised interview was that "People were still drunk on the Hope & Change elixir when it was happening during Obama's tenure, and didn't get the hangover until Trump's tenure"