The Superman II ending explained in one line: Superman beats Zod, Ursa and Non by turning the Fortress of Solitude chamber against them, then undoes the emotional damage by making Lois forget. Spoilers follow.
The trap depends on the villains trusting Lex Luthor. Luthor escaped prison with help from Eve Teschmacher and bargained for Australia, and he tells Zod's group how the crystal chamber removes powers. Superman has changed it, so only the three Kryptonians lose theirs. Zod, Ursa and Non end the film helpless, and Luthor is taken into custody. In my opinion this is the neatest reversal in the film, because the villains defeat themselves by stepping into the one room Superman has had time to rig. The Fortress is also where Clark gave up his powers for Lois, so the film ends its central argument in the place where it began.
The kiss is the harder moment. Lois is heartbroken, and Superman wipes her memory of their time together so that Clark can return to his double life. The kiss undoes the choice Clark made in the Fortress, and Lois has no say in it. In my opinion it reads as a retcon of the romance the film spent most of its length building, and it is the part of the ending that divides viewers most.
The diner closes the loop. Clark was beaten there while powerless, so Superman returns to settle accounts with the bully, then repairs the damage Zod caused and restores the flag at the White House. That sequence ties the Metropolis battle, which plays out on sets built on the Pinewood Studios back lot, to the small-scale humiliation in the diner. The film is as interested in what Clark pays for a normal life as in how he beats the villains.
The ending leaves Clark's secret intact for Superman III, the next film in both release and chronological order. Production credits add a wrinkle: Richard Lester is the credited director, while Box Office Mojo's credits page also lists Richard Donner, and Geoffrey Unsworth and Robert Paynter are both credited as cinematographers. None of those records says which of them handled individual scenes, so the finished ending is best treated as a collaborative credit rather than one person's work.
The scale of the film's reception suggests audiences accepted the trade. Box Office Mojo reports $216 million worldwide on a $54 million budget. This leaves Superman once again committed to protecting the world, with his secret identity safe.