What was it..
It is nothing but her saliva.
The purpose is to get revenge. Earlier Greta had called Amy a rich spoiled girl(most probably), to which she disagreed. But she could not confront Greta as she was in disguise. So when she had the moment she spitted in her glass.
It was her own way of taking revenge on Greta. She did it so that she can have the pleasure to watch Greta drink her saliva.