The casting director decides who's going to play what role.

The popular perception is that it's the director or producer who does that. This isn't wrong; when the director has someone in mind for a particular role he or she is empowered to make that decision, but that isn't the case with all roles in all productions; the casting director is responsible for all major roles (and often does the actual approaching even when the director has a name in mind).