Shanks and Buggy humanise each other
They are truly each other's best part, if only for the sake of character development.
Buggy originally comes off as this annoying, one-dimensional villain that Luffy gets to beat up and move past. He acts like a stereotypical pirate, and his introduction (seemingly) being about him holding a grudge because he lost a treasure map only adds to this.
It seems like what he wants is to be a great pirate with lots of riches, with a crew that fears and obeys him. It sounds cliche and it's because it is. Buggy is trying to flashy and dramatic, and so he falls into becoming like any kind of storybook pirate, one who wants fame and riches by any means neccessary.
Even moving past it, if we look into his other appearances, we only find more things to support this idea. He acts selfish and lies to get what he wants. He has poor foresight and even when he tries to play it cautious, it somehow blows up in his face.
The only things about him that allows him to make it this far is luck and charisma, with him landing into situations where he's able to make people follow him and worship him blindly.
He plays into the trope of a recurring small-time villain that continues to be a nuisance, never actually gotten rid of until the end. Maybe to the point that it gets annoying, because there doesn't seem to be a point to him being there.
Shanks also has the issue where he stepped into the role of a 'mentor' for Luffy. Though, calling him a 'rolemodel' or 'inspiration' for him, would be more accurate. He doesn't really teach Luffy much but he acts as the catalyst to Luffy becoming a pirate, with the hat he gave Luffy becoming his main identifier.
But after that first appearance, we barely see him. The times we see him are short and often very vague on his part, with the conversation coming off as cryptic to anyone who doesn't know what exactly is happening (which is most of the time, dammit shanks).
This does establish Shanks as a man with a lot of 'aura'. The most notable moment of this is when he makes multiple people faint when he just steps onto whitebeards ship, his haki being that powerful. He doesn't need to unsheath his sword to accomplish this. He didn't even need to make eye contact.
Then there is also how he seems to know more that what is already revealed in the story so far, seeming as though he has a plan that he has been preparing for, and waiting patiently for the time to enact it. His followers trust him implicitly, and even other powerful figures hold respect.
Altogether, he's meant to be a powerful, mysterious and important man, to the point that he can stop a war with his mere presence. But this reduces him to a figure rather than an actual character. He symbolises more things than actual showing character for the audience to see.
In both of their cases, there play into a trope that is a bit cliche and very one-dimensional. They don't exactly feel whole enough to care about.
That is, until you add in their relationship. Suddenly they have a lot more depth to their character.
They were both cabin boys who grew up on the Oro Jackson, acting like typical boy who were rowdy and constantly fighting each other. Despite this, they were also clearly friends, who would sneak alcohol and have long talks about their goals and dreams.
Buggy's greed and desire for fame is built off of living in the shadow of his childhood friend. He didn't always chase his dream and was willing to step back to let Shanks be the one to take charge of their dream to find the One Piece. Shanks stepping back and saying he wasn't going to chase it just yet, was enough for Buggy's dream to crumble, and he places this blame onto Shank's shoulder.
He stuck in the East Blue because he had such a strong inferiority complex that, combined with his own pride, refused to kept him even try to venture into the Grand Line until a boy with the same hat that his childhood friend had made him 'mad enough' to go there.
Shanks on the other hand, didn't aim for fame or glory at his heart. When they were kids, he tells Buggy that he just wants to go around and see the world. A simple dream, that doesn't need to money nor fame to achieve. (Though power is likely needed)
When we see him again in Elbaf, he says that when he was younger, all he wanted to be was carefree pirates with Buggy. Once again, its a dream that doesn't need money or fame or even power to achieve. It's simple, it’s peaceful and it's carefree.
But he also bore the weight of the world's destiny on his shoulders, and had to give uo that dream to fulfill his own 'role' in this destiny. He was a child of destiny, after all. He didn't have a choice.
He grew into the habit of just...sacrificing. He would give up so much for the people he cared about, and left behind dreams for the sake of the world. There was little room for what he wanted, not when he was a key part in the future.
Even so, Buggy was reason enough to give up on the chance to see the One Piece, choosing to stay back and take care of Buggy instead. He didn't even hesitate for a second, saying that they go there when they have their own ship.
He still asks Buggy to come with him after Roger's execution. He still takes the chance of straying away from the path of destiny, and follow that dream of being carefree, maybe even abandoning his 'duty' as a child of destiny.
He was, unlike Buggy, extremely selfless. But when it comes to Buggy, we get to see the parts of him that yearn and want. The parts which are childish and emotional.
It's easy to point out how their dreams directly contradict each other while still involving the other to an extent.
Buggy wanted to become great pirates and be rivals with Shanks, and adjusted that dream to just following him into greatness. But he didn't have the power to achieve it, like Shanks.
Shanks wanted to become carefree pirates with Buggy, sail on their ships and see the world. But he wasn't selfish enough to do it, unlike Buggy.
They just parallel, contradict and compliment each other, all at the same time.