This is documented in the method description: 'Executes a Query against an ArcGIS Server map layer. The result is an array of object IDs for features that satisfy the input query.' Refer to this link for the summary:
https://developers.arcgis.com/javascript/3/jsapi/querytask-amd.html#executeforids