The 20-year-old singer is said to be having fun with Foster, who has previously been romantically linked with Ryan Gosling and Samantha Ronson, in recent weeks but he first got to know her through Kimberly Stewart, who he briefly dated last year, reported Contactmusic.
"Erin and Harry met through Kimberly Stewart over a year ago and stayed in touch. Erin's dad David is a top music producer and a good friend of Kimberly's dad Ro," a source said.
"When Harry was seeing Kimberly briefly last year, he stayed at the Stewarts' mansion and saw David a lot.
Styles, who has previously dated Caroline Flack, Taylor Swift and Kendall Jenner, was recently romantically linked with Katy Perry after they enjoyed an intimate dinner.