I think there could be many reasons behind it.
here are some possible reasons:
stretching
they can't brush themselves so maybe they are shaking so their fur lays the right way
many times if they have an ear itch or ear problem they shake
an itch might make them shake
just to wake up a bit, like how we stretch