To imitate someone is to do exactly what they do, to behave like them. To flatter someone is to say nice things to them, often to influence them or make them have a positive opinion of you. So the expression, “Imitation is the highest form of flattery” means that doing something the way someone else does it is actually a compliment to them. You are saying: I am doing this because I like your idea/behavior.
To mimic is similar to to imitate. It usually means to do the same physical actions as someone else. A recent study reported in the New York Times says that mimicking someone else’s movements and speech actually does make that person like you more, as long as they don’t notice or realize that you are mimicking them. For example, you are talking to someone at dinner, and then she crosses her legs (puts one leg on top of the other at the knees). A few seconds later (you have to wait, or they will notice you mimicking them!), you cross your legs. Then she puts her hand to her face. Three or four seconds later, you put your hand to your face in the same way. Pretty soon she will start to like you more, to be more sympathetic toward you.
People are able to pick up on (comprehend, sense) things and react to them even if they are not conscious of it. This is a trick that salespeople sometimes use, and of course men trying to pick up (get a date with) women. Now the research suggests that this may actually work. So if you are looking for that special someone to fall in love with, you might try a little mimicking. But once again, be careful! If they realize that you are trying to mimic them, they may get angry with you.