Pelosi obviously had a preferred replacement for Biden, but Biden's puppeteers promoted Harris before anyone else could be pushed in - maybe even with a sham quicky primary. I wonder who Pelosi had picked.
There was some talk about the choice having to be Harris because if it wasn't her the campaign warchest couldn't have been tapped, but if there were rules to that effect I doubt they would have been enforced between Democrats on the FEC and the courts
According to Lindy Li (former DNC donor and fundraiser) Biden picked Harris as his VP because James Clyburn wanted him to, and he felt that he needed Clyburn’s support to win.