One thing that consistently motivates or inspires Stargirl's acts of kindness is her innate altruistic attitude and general love for other people. Stargirl is unique in that she loves everybody equally and unconditionally. She's quite amazing in this regard. I can't think of anybody else that would be able to take a slap from Hillari and then kiss her in return and walk away. With that said, chapter 21 has Stargirl telling Leo more specifically how she figures out which "random" person she should target for her random acts of kindness.
1. She reads the newspaper, and she pays special attention to things like death notices, birthday and wedding announcements, and so on.
What she read were the parts that most people ignored, the parts without headlines and pictures, the boondocks of the paper: the hospital admissions, the death notices, the birthday and wedding announcements, the police blotter, the coming events calendar.
2. Stargirl eavesdrops on conversations that occur in places like the hair salon.
There’s also the place where I get my hair cut. I always overhear good stuff there.
3. Stargirl gets information about people from bulletin boards that are posted all around town. She learns from these about people that have lost a pet or just opened a business.