While attribute queries select features by sorting through attribute records, spatial selection chooses features from the map in the user interface.
In most cases, it selects features from one layer that fall within or touches an edge of polygon features in a second layer (or an interactively drawn graphic polygon). Spatial query operations generally are not available in raster-based GIS packages even though these packages have SQL attribute data queries.
Select by Location in ArcGIS
The Select By Location tool selects features based on their location relative to features in another map layer. For instance, if you want to know how many homes were affected by a recent flood, you could select all the homes (layer 1) that fall within the flood boundary (layer 2).A variety of selection methods are available to select the point, line, or polygon features in one layer that are near or overlap the features in the same or another layer. Based on the example screenshot below, when the query is executed, all cities that are contained within the source layer ('cma') polygon feature will be selected.