Why does query parameter type affects mysql index choice?
Query processing takes the given SQL, applies a set of rules and heuristics and comes up with an execution plan. This states which indexes are used and how. The outcome is dependent on the input and how the rules have been written.

Given a slightly different start point a different end point may result. It's somewhat like dropping a ball in a landscape of river vallies. Drop it once and it will roll into a river. Drop it in a slightly different place and chances are it will roll down into the same river. Occasionally, if you're near a ridge, you drop the ball in a slightly different place and it rolls into the next river instead.