This is another move that seemed inevitable following the hiring of Jim Harbaugh. Hortiz has been with the Ravens since '98, going from Personnel Assistant -> Pro Scout -> Area Scout -> National Scout -> Director of College Scouting and, since 2019, Director of Player Personnel. Say whatever you want about the Ravens, but they have been a consistently successful program as long as he has been there (which is basically their entire history).
One of the Chargers greatest weaknesses during Tom Telesco's tenure was finding talent outside of day one. Since taking over as director of pro scouting, the Ravens got hits in day 2 & 3 with talented players like Ladarius Webb, Dennis Pitta, Ryan Jensen, Kyle Juszczyk, Za'Darius Smith, Matthew Judon, Tyus Bowser, Chris Wormley, Orlando Brown Jr, Mark Andrews, Ben Powers, Devin Duvernay, Justin Madubuike, JK Dobbins, Odafe Oweh, Isiah Likely, and more. Thats not to even mention that they got a 2x MVP with the last pick of the first round (behind QBs like Darnold and Josh Rosen).
And as far as free agency goes, its tough to find a signing you can call a bust.
Compare this to Telesco, who could not manage to draft outside of the first round to save his life. And even then, the first rounders were really a crapshoot (DJ Fluker, Jason Verrett, Melvin Gordon & Jerry Tillery all being massive stinkers/injury liabilities and Zion and QJ looking to not be great either.) He had plenty of busts in free agency as well, not retaining good players and swinging on plenty of shitty ones, including the most recent disaster with J.C. Jackson (which may be the worst NFL FA bust of all time?).
Ravens fans that I know seem to love him & are sad to let him go which, to me, is a great sign. Jim is going to be in more of a hybrid gm role so Hortiz figures to be a guy that will help facilitate whatever Jim wants.