VTGate knows two things about your Vitess components: the Vschema and the schema of MySQL. 

This enables VTGate to look at the WHERE clause of the query and then route the queries to correct shards. VTGate is also aware of the sharding metadata, cluster state, required latency, and availability of tables, so it will only scatter the query across the shards it needs to use.