Those events have not happened in the comics, as far as I know, (been reading the Avengers for nearly 30 years) but are likely to be part of whatever movie magic the Marvel Cinema Universe concocts in the future for both Hawkeye and the Black Widow.
Loki is a being whose powers are far beyond mortal humans. He is a sorcerer and a trickster. He likely used some sort of divination magic and/or mind-control magic (on Hawkeye) to get information about the Avengers and the Black Widow.
He learned about events they were both engaged in that would have her in debt (in the red) to him and saved them for just the right moment when he thought he could secretly crush her emotionally and convince her to liberate him.
Loki, playing the deck from the middle, had already planted the seeds of discord among the Avengers from the very first time he met them (Thor's appearance disrupted his plans but not by much, Thor being very obtuse in the thinking department).
He assumed that the Black Widow's emotional appearance meant he was successful in his emotional attack but he did not count on the Widow's "interrogation" technique that put her in a submissive role in order to gather information from her enemies.