As a beginner researcher, several years ago, I sent some (2-3) papers to a quality journal (with ISI IF). The papers were rejected. Now I am preparing a manuscript, which is in my opinion much more mature. In the meantime I had some papers published in other journals. Now I am considering the same journal again, because of the topic. Is it a good idea ? Or is there going to be some bias because of earlier rejections ? Just to clarify: this is a completely new manuscript.
This is perfectly legit. You are not forbidden to submit ever again to a journal that has rejected one of your earlier manuscripts. Indeed, rejections happen for everyone. It is best not to take them too badly.
Now, it would be a different story if you resubmitted the same paper that was previously rejected, or a version with only minor updates. Sending an entirely new manuscript, or a much more mature version, is unproblematic.
Or is there going to be some bias because of earlier rejections ?
Important journals get many submissions, the majority of which they have to reject. I think it is very unlikely that the responsible editor even remembers that you already had a paper rejected a few years back. And even if (s)he does, it is unlikely that (s)he holds it against you. As I said, rejection is something that happens to every researcher, at least now and then.
Not only is this a good idea, but its relatively common, and a decent publication strategy overall. Given a particular topic is likely to have more than one journal, a way to decide where to submit is to submit it to the "top" journal that you think you have a shot at getting into (you shouldn't submit work that has no chance - its a waste of your time and theirs), and then letting the paper "slide" down the rankings as it gets rejected.
Rejection doesn't even imply that you submitted to the wrong journal, or that the work wasn't worth trying to get in there - the vagaries of editorial discretion, publishing cycles, and reviewers mean something might have had a legitimate shot at getting in but just missed this time. The next paper? Start the process over again.
Unless your submission is egregious enough to be memorably bad, the odds of the editors holding rejections against you, or even remembering you specifically, are pretty low.
In addition to xLeitix's answer, which hits on most of the main points, I would add one further suggestion, if the manuscript is a revised version of a previously rejected manuscript.
As part of the cover letter to the editor, you should indicate that this is a resubmission of the previous paper. You should also outline clearly what has changed from the previous manuscript to the current one: what have you added or removed, and how the present manuscript is an improvement over the previous version.