Gentrification has a part, but so does the work of city & community leader. East Palo Alto became a city in 1983, before that the county handled the area's affairs...and given the smaller size/population it was not a primary focus.
A lot of credit goes towards the police relationship - https://www.mercurynews.com/2018/01/02/how-east-palo-alto-sh...