There may be a quality about that other person that your current partner lacks. You may have noticed this quality in this person when you observed them in the past.
Your mind may have then proceeded to fill in the blanks in terms of how amazing it would be to be with a person who has that particular quality.
The more you think about that, the more you become emotionally invested in the person even though you may not even know this person all that well, if at all. This is often what leads to you developing feelings for the person.
Think about what may be lacking in your current relationship that you strongly desire. There is a good chance that this other person probably possesses what is lacking and you have now found yourself gravitating towards this person as a result.