Bed heights are set with blocks/plates and pins.
The upper bed can be blocked in two upper positions by the use of the four supplied pins. You would do this if you prefereed the upper bunk stay at ceiling height regardless of lower bunk position. Useful for using the lower bunks as seating.
The lower position of the upper bunk can be adjusted with this plate. If you look close at the pictures you can see multiple holes, but only the two holes above the plate are threaded.
On mine, I have the plate in the lower position, giving the most headroom.
You can also "flip" the "L" shaped brackets on the bunks to gain some additional adjustment.
The lower bunk also has a similar but different way of setting the lower height.
You can see that in this picture. Again, with mine I have ii in the lower position (the upper bunks have similar "trolleys").
The limit switches turn the motor off when travel "limit" has been reached and do not set heights. This prevents damage to the motor and or bed lift mechanical parts.