You walk into the wedding party of a close friend; you know that you’re going to have to speak with people, so you get ready.
Some of the guests are close friends, some you’ve met once or twice before and a few you have never met. Imagine if you were to walk up to one of your oldest and dearest friends and formally introduce yourself as though they were a stranger. Or go to a guest you have met for the very first time and, without any introduction, proceed to launch into the gory details of a particularly unpleasant bout of food poisoning you’d just experienced - chances are they’ll be avoiding you for the rest of the nuptials.
The way you greet each of the guests will differ, because the relationship differs - it’s all about context.