The basic distinction is that we use what when the set of things to choose from is unlimited, but which when the set is limited.
This means that we say What is your favourite company?, since the set to choose from is unlimited, but Which is your favourite colour, green or blue?, since the set from which we choose is here limited.
We say What languages do you speak? (since the set is almost unlimited), but, Which language do you speak, German or Italian? (since the set is limited).
For more on this topic, see the following: