It's polite to acknowledge and greet people you know.
Julie is shopping, but starts feeling sick in the store.
Julie wants to hurry so she can go home.
Julie waves at the friend, telling her in passing she feels bad, and is able to end her shopping trip early.
Julie sees a friend in the store, but doesn't greet her, so she can not spend the time chatting and quickly leave.
The friend waves back, says she understands, and wishes Julie a speedy recovery.
The friend's feelings are hurt because she saw Julie ignore her, so she tells their mutual friends that Julie is rude and avoids her in the future.