How does Rasa core decides to ask user for more information when the intent has more than one required entity?

For example, in restaurant bot when user ask for a restaurant, the bot need to collect {cuisine, location, numberOfPeople} from the user, is it by defining the stories to let all stories having all of these entities so that the model learns to prefer the next action to be askCusine, askLocation, askNumberOfPeople than others before all these slots are filled? Or some other way? Which python module contains the code to handle this? Thanks.

I think they are using forms to perform this (Slot Filling)

It is how you handle asking for more information when all the slots are not filled in the first sentence. All the code needed is on the doc, never tried it myself tho