If you accidentally, and by chance, met someone unexpectedly on the street, for example, then you might say, "Fancy bumping into you!" In other words, imagine seeing you, of all the people in the world, here on the street, of all the places in the city or country.The word "fancy" has the meaning "imagine" in this case, such as in the expression, "Fancy that!"