There have been instances where Spider-Man and Captain Marvel have squared off in the comics. It usually depends on the circumstances and the overall narrative of the comic series.
In some fanfictions, the winner isn't really about who is more powerful physically or technologically. It could be about who has the stronger will or the better moral compass. For example, if Iron Man realizes that he's in the wrong during the fight, he might back down, making Spider - Man the 'winner' in a sense. Or if Spider - Man is able to convince Iron Man of a greater good, the fight could end without a clear physical victor.
Well, it could start with Spider - Man being framed for a crime he didn't commit. The Avengers believe in his innocence. They fight for him against a corrupt government agency that wants to arrest him. Along the way, they discover that there's a bigger conspiracy at play. Black Widow uses her espionage skills to gather intel, Hulk provides the brute force when they face the agency's armed forces, and the other Avengers contribute in their own ways to clear Spider - Man's name and protect him from harm.
Power struggles can be a reason. Spider Man, being a solo hero with his own set of powers and moral code, might not agree with Shield's more bureaucratic and sometimes secretive ways of handling things, so they clash. For example, Shield might want to control Spider Man's actions, which he resists. This can lead to a fight. Also, there could be a villain manipulating events behind the scenes to make it seem like Spider Man is against Shield or vice versa.
Well, initially, the Avengers might underestimate Spider - Man. They think he's just a kid in a suit. But Spider - Man quickly shows them his skills. He could start by taking out Hawkeye's arrows mid - air with his webs. Black Widow would try to use her combat skills against him, but Spider - Man is too fast. The fight could then move to a more strategic level. The Avengers could use their combined powers to try and trap Spider - Man. However, Spider - Man's intelligence and quick thinking could help him find a way out. Eventually, they might realize they've been misled and join forces with Spider - Man.
Well, it could be an interesting idea. On one hand, the Avengers are a powerful group, and pitting them against Spider - Man could create some intense battles. It would also allow for exploring different power dynamics and relationships. However, it might seem a bit odd since Spider - Man is often seen as a hero among heroes. But if the fanfic has a good backstory, like some misunderstanding or an outside force manipulating the situation, it could work really well.
It could be Doctor Octopus. He's always been a formidable foe for Spider - Man. In this fanfiction, he might have a plan that involves not just Spider - Man but also threatens the Avengers in some way, so they have to fight him to protect Spider - Man.
White Tiger has great combat skills and agility. Spider - Man has his super strength, web - slinging ability, and spider - sense. In a fight, Spider - Man could use his webs to create barriers or traps for the enemies, while White Tiger could use her agility to quickly move around and attack from unexpected angles. Their combined powers would make them a very formidable team.
Spider - Man's agility and web - slinging could be used in tandem with the Guardians' ranged attacks. For example, he could web up enemies and then Star - Lord could shoot at them while they're immobilized. Or Gamora could use Spider - Man as a distraction, swinging him around with his webs to confuse opponents, and then she could move in for a stealthy strike.
One possible reason could be a misunderstanding. Maybe there was some misinformation spread that made them think the other was a threat. For example, a villain could have framed Spider - Man as being a danger to the city, and Captain America, being the protector of the people, decides to take him on. Or it could be the opposite, with Spider - Man believing Captain America has gone too far in some mission - related decision.