The ending of Black Widow (2021) closes the Red Room story and then returns Natasha to the Avengers timeline, and in my opinion it is a clean handoff. Dreykov is dead, the base is destroyed and Antonia is freed from his control. Yelena leaves with the antidote and a list of other Widows she can free, which is the thread that carries her into later films.
Why does the film end with a Quinjet? Two weeks later Natasha takes the aircraft from Mason and flies off to rescue the Avengers held in prison. That places the film just after Captain America: Civil War and sets up Avengers: Infinity War. So, although Black Widow (2021) was released after Avengers: Endgame, it plays out earlier in the story.
Is it a prequel? In story order, yes: it is 16th of the main films chronologically, while release order puts it 22nd. Both orders are on Marvel movies in order. It is also an unusual kind of prequel. Captain Marvel (2019) opens in 1995 as well, but sits 2nd in story order and builds a new hero from scratch, whereas this film opens in 1995 only to jump to 2016 and wrap up a character the saga had already followed since Iron Man 2.
Perhaps the best choice in the ending is that Natasha defeats Dreykov by breaking her own nose, which gets her past the scent that stops Widows from harming him. I read it as the film's argument that her strength comes from choosing pain over control, though that is my interpretation, not something the film states. The rescue of Antonia works in a similar way: Taskmaster, who can copy any fighting style, is beaten not by a better fighter but by the antidote, so the finale pays off the vials Yelena sends in the first act.
One production detail helps explain the shape of the story. Eric Pearson received sole screenplay credit, with Jac Schaeffer and Ned Benson credited for the story, according to Wikipedia read alongside Box Office Mojo and The Numbers. A film built from three writing credits and a director, Cate Shortland, working to link two earlier films may explain why the family plot and the Avengers bridge sit side by side so tidily. Compared with the political split of Civil War or the cosmic scale of Infinity War, the stakes here are personal, and the post credit grave scene shows that the film's closing beat looks forward to Yelena rather than back to Natasha.
Why did Scarlett Johansson quit Marvel? No studio or trade report gives a reason, so any explanation would be speculation. What the films show is that Johansson's Natasha runs from Iron Man 2 to this film, and the film's final image is her grave, with Yelena carrying the Black Widow name into later stories.