From what I've gathered, they (studio head, producer, director, etc.) brainstorm and throw some names around. They come up with a list and discuss the pros and cons of each one until they've cut some people. They'd discuss who is available at that time, who's hot, whose movies are making money, who's getting buzz for their current projects, what's each actress' asking salary, etc. If they have a pretty powerful writer (like, say, Aaron Sorkin) then his input is also valuable to the "list". Usually, agents play a part too. There would be stuff like Agent X will send an email (or call) and say "Hey, I heard you're casting Captain Marvel. *insert actress* would be great for the role! She's like to have a meeting with *insert director*". Once they've narrowed it down, the actresses will meet with the director (maybe even the producer) and see if their vision for the character jives. Depending on the role, there could be screen-tests too to even narrow down the list to like one or two people. An offer would eventually be made once a consensus is made with a few backups in case the talks fall apart for whatever reason. You'd have cases too where the director wants someone, the writer wants another one, and the studio demands a completely different one. In such case, whoever is most powerful will have the last word.