how do the nanoparticles know which cells are cancerous to attach to?
No real idea, I suspect there is a difference in proteins or some such that is exploited to mark the correct cells.