The last time I was flying on my first flight I saw the flight attendant do that on her way back to the rear of the aircraft. During that same flight, I had to use the lav and it was a little bumpy so I did as she did when I went towards the back. It really does make you feel more stable walking.
On another flight, I never did see the flight attendant do that and there was a bin that a guy thought he had closed and it wasn't all the way. No one knew it until we were on the runway and took off. Upon rotation as mentioned earlier and climb out, the bin door flew open and a heavy back pack fell out and almost hit a woman in the head. Just after that, the captain "rang" for the flight attendant. I heard her say that it was only something falling out of the bin (I was sitting in a seat across from her jumpseat).
That's why they do it.