Some fanfictions have the idea that while in detention, Harry and Snape are magically bound to work together on a special potion. This potion has the power to reveal hidden secrets. As they work on it, they start to share their own secrets, like Snape's unrequited love for Lily and Harry's fears about Voldemort. It's a really interesting way to develop their relationship.
Perhaps in the fanfiction, Snape assigns Harry to clean all the old potion vials in the storage room during detention. While doing so, Harry discovers an old diary that seems to hold secrets about Snape's past at Hogwarts, which then leads to a series of revelations and a change in their relationship.
Well, Harry could be forced to clean the Potions classroom during detention. Snape might make him scrub every cauldron by hand while muttering about how clumsy Gryffindors are. Harry might accidentally spill a potion ingredient, which makes Snape even angrier and gives him more tasks to do, like sorting out all the potion ingredients in the store cupboard.
Another idea is that Snape could be the one who discovers a plot by a Death Eater to use the Triwizard Tournament to bring Voldemort back in a more powerful form. Snape then has to decide whether to take matters into his own hands or trust Dumbledore with this information. This would create a lot of tension and drama as Snape is not one to easily trust or be trusted.
Another plot could be that Snape assigns the student to clean his office during detention. While cleaning, the student finds old parchments and journals that give insights into Snape's past, especially his time as a student at Hogwarts. The student becomes more empathetic towards Snape after learning about his difficult past and tries to befriend him, which Snape initially resists but gradually warms up to.
Well, in a detention with Snape in a Harry Potter fanfic, Harry might be forced to clean out the Potions storeroom. Snape could use this time to lecture Harry about his lack of respect for Potions as a subject. Maybe he would also drop some hints about Harry's father, James, which could be both infuriating and enlightening for Harry.
A common scenario is that Harry is made to scrub cauldrons. Snape would be hovering nearby, making sarcastic remarks about Harry's sloppiness. Another one could be that Harry has to organize Snape's Potions ingredients in alphabetical order while Snape quizzes him on their properties.
One interesting scenario could be that during detention, Snape makes Harry clean all the potion bottles in the dungeon while lecturing him about the importance of precision in potions. Harry, in turn, discovers an old, forgotten potion recipe among the bottles and Snape is grudgingly impressed.
Harry would probably be quite resentful at first. He might think Snape is just being his usual unfair self. So, he would be sulky and do the tasks reluctantly.
In a Harry and Snape detention fanfiction, Harry might finally have a chance to understand Snape better. He could see that Snape's strictness is not just pure malice but perhaps a result of his complex past. Snape, on the other hand, could start to see Harry not just as James Potter's son, but as an individual with his own struggles. They might end up having a conversation about magic that neither expected, leading to a newfound respect for each other.
Maybe in the fanfic, Snape gives Hermione detention for accidentally disrupting his class. But instead of a typical punishment, he assigns her to help him organize his personal library of dark arts books. As they work together, Hermione begins to understand Snape's complex past and Snape starts to see Hermione in a new light, beyond just being a know - it - all Gryffindor.