What does MySQL actually use to decide which index should be used?
What is in the WHERE clause.
An estimation of how many rows will be fetched -- to decide whether to use an index, or simply scan the table.
Size of two tables in a JOIN -- if there is no other good way to decidw which table to start with.
The value of N in a LIMIT rarely matters.
Whether the columns's datatypes match -- mismatch of COLLATION may inhibit use of an index.
Not used: whether the needed blocks is already cached in RAM.
Not used: Spinning disk vs SSD.  (There is a tunable in 8.0 to help.)
In certain situations, an index is dynamically created for a subquery.
Size of the index.
"Cost" of the various options.
ORDER BY is used only if the entire WHERE and GROUP BY are handled first.  Or the Optimizer may skip the WHERE and only use an index for the ORDER BY, thereby avoiding 'filesort'.
GROUP BY and ORDER BY, of not compatible enough may lead to two filesorts.


See EXPLAIN FORMAT=JSON SELECT ... for some extra clues.  See also the "Optimizer trace".

My cookbook approaches your question in a different way...  "Given this SELECT, what is the best INDEX for it?"