The womb was such a warm place to sleep and being put straight onto a flat, mattress is not exactly a smooth transition. This is why baby hammocks work. They allow the baby to be cradled in a foetal position to sleep.
As they gently move so does the hammock imitating life in the warm cosy womb. The gentle swaying of the hammock can soothe a restless baby and help bring them to sleep. It can also help to bring wakeful babies back to a sleeping state at night or for nap times.
As your baby gets older, their strength in kicking their legs and swinging their arms will help them self-sway the hammock and they can often bring themselves back to sleep.