To be slightly more specific, if you leave both WiFi and mobile data turned on and you have a valid WiFi connection, your phone will use the WiFi connection for all normal data requests. However, in certain cases, you'll see the mobile data icon shown in the Status bar while it handles the special request (the WiFi icon will also remain in the Status bar) and then the mobile data icon will go away once the request is serviced.
If you turn mobile data off and have a valid WiFi connection, all normal data requests will be serviced, but if a special case occurs that request will NOT be serviced until you turn mobile data on.
One example of this scenario is MMS - if someone sends you an MMS and you have mobile data turned off, you'll see a placeholder in the Messaging app that says something like "Downloading", but that download won't complete until you turn mobile data on (and press the download button). If you have both WiFi and mobile data turned on, when an MMS comes in you'll briefly see the mobile data icon come on and then go away, and when you open the Messaging app your MMS will already be there.
Sent from my rooted, debloated, deodexed Sinclair ZX-80 running CM -0.001 using Tapatalk 2