What's the mechanism to maintain this shelf stable
The general term for a hinge that allows something to move but keep the same orientation is a "pantograph hinge".  The general term for that type of bed would be a "Murphy bed".

The pantograph mechanism takes many forms, but the trick it uses is to have parallel connecting rods that pivot together so that the door or shelf that it is connected to can swing out, but maintain it's orientation because the pivot points remain parallel.

I know that is a bit abstract, but that will give you a starting point to research the topic more.  This is not a "standard" piece of hardware that you can pick up at the hardware store, so there't not a specific product I can link to.  I'm sure the design for that bed is custom.



Here you can see the basic concept with two parallel arms that allow the black leg to swivel downward while maintaining its vertical orientation.  If this was the "leg" on the bed that held a shelf, you could imagine another red bar connected to the head of the bed to actuate the leg movement as the bed is swiveled down.

The bars of the system can also be replaced by cables and a pulley system which is what could make it so compact and hidden in that Oslo bed.  I suppose they could even use a gear driven system with cables and pulleys.  Either way, it's custom designed and built just for that purpose.