There is one more consideration I don't see discussed in any other answers: time.
Often (but not always), the higher IF journals have a longer "time to first decision". Even if they do not, the higher you aim, the lowers your chances of acceptance, and if your paper gets rejected, resubmitting to a different journal takes time. So, given infinite time, I agree that the best strategy is to start with the highest IF journal which matches the topic of your work (and a good match is essential), however, most researchers do not have infinite time.
There is definitely something to be said about aiming high enough: if all your papers are getting accepted with minor to no revisions, you are likely aiming too low. If most of your papers are getting rejected, you are likely aiming too high. And striking the right balance needs to take time available into account.
We recently had to decide on a publishing strategy with a postdoc nearing the end of their contract. Their publication output in the first part of the postdoc was a bit on the low side, especially because of "aiming high" (not "too high" mind you -- then, they still had plenty of time to shoot that high). So when discussing targets, we ordered the journals according to IF, as well as time to first decision (as much as we could find that information online), and discussed how likely we consider the acceptance to each of those (both according to the topic, and the level of novelty). The final decision was made to maximise (in our opinion) the chances of their work getting published before the end of their contract in good, but not the best, journals and conferences.
So, my own personal strategy is highest-IF-given-available-time (and given a good topic fit), which often does not mean only my time (I'm in a permanent post, so have plenty) but also the time of everybody on the author list.
Note that most of these considerations don't really hold for MDPI journals -- they have a suspiciously short turnaround time. I also echo what many others voiced about MDPI -- I do not like their practices, and while some of their journals are better than others, I would not consider submitting there any longer.