I think this is because Google compiles these cast lists based on search proximity prevalence. So if you look up some actor and a movie in the same query many times it starts to assume the actor is in that movie. Maybe they combine this with some base scraping but I think it's highly unlikely they use some API or hand craft the lists.