From memory, the top seatpost has a slot on one side where the bolt passes through, which is not visible in the image. This allows a range of movement. The underside of the bolt head is either not flat, or it is in a cone-washer that conforms to a conically-sided hole.
However with two smooth sides pressing together, the only thing stopping the clamp from sliding is pressure.
Your second seatpost is "superior", though a two-bolt design leaves them both behind for strength and adjustability.