It uses heuristics or rules of thumb and statistics to decide on the most efficient execution plan based on available indexes, table size, and query complexity.