The Empire Strikes Back ends with Han Solo frozen in carbonite and taken by Boba Fett, Luke Skywalker maimed after learning Darth Vader is his father, and the heroes vowing to rescue Han. Luke escapes Vader, loses a hand and learns that Vader is his father. Princess Leia and the others recover him and flee Cloud City, with the Falcon's hyperdrive finally working. Luke, Leia, Lando and the droids watch the stars and decide to go after Han, which sets up the next film.
Why does it work as an ending? The film keeps its two threads honest by making each cost something. Luke's rescue attempt on Cloud City, against the advice of Yoda and Obi-Wan, is exactly the anger Yoda warned him about on Dagobah, and the price is a hand and a harder truth. Han's capture is the other price, and it is paid by the whole group.
The scenes are built to pay each other off. On Hoth, Luke is nearly frozen by the snow creature before Han finds him. At Cloud City, Vader tests the carbonite process on Han, so the cold that almost killed Luke in the first act returns as a weapon in the third. The Falcon's damaged hyperdrive, a problem from the flight through the asteroid field, is not solved until the escape from Cloud City, so the ship's failure keeps the group trapped and vulnerable through the whole middle of the film. Lando's arc closes the same way: he hands the group to Vader, then, ashamed, helps Leia and Chewbacca escape, and he is on the Falcon when it picks Luke up after the shaft.
Production history shows how deliberately the Dagobah section was trimmed. According to StarWars.com, two Dagobah lightsaber practice scenes stayed in the script until July 23, 1979, and were later cut. In my reading, that leaves Yoda's lessons about the Force and anger as the training that matters, which makes Luke's decision to leave early the clear test of what he took in. That is interpretation, not a stated intention of the filmmakers. The same StarWars.com piece notes the naming shift behind Cloud City's setting: in Leigh Brackett's early screenplay the cloud planet was named Hoth, and George Lucas's second draft made the ice planet Hoth and the cloud planet Bespin. The film's two halves, ice and cloud, were therefore shaped across drafts by more than one writer, and the screenplay credit lists Lawrence Kasdan, Leigh Brackett and George Lucas.
The comparison with the original Star Wars is useful, because there the Death Star is destroyed and the film closes on a win. Here the Rebels flee from Hoth, lose Han and have no victory to show, which is why the fleet scene with Luke's robotic hand feels quiet rather than triumphant. That is my opinion of the tone, but the plot facts behind it are plain: the Rebels end the film scattered and short a friend. Release order also matters here. This is the second film released and the eighth in chronological order, so it sits in the middle of the story, and it is the only one of the three films in the original run that ends with its heroes still chasing a goal rather than celebrating one. Even the box office fits a film built to be continued: it earned $550 million worldwide on an $18 million budget, according to Box Office Mojo.
The story continues in Return of the Jedi, and the stated goal at the close, going after Han, is the thread it picks up.