I gather you haven't served in the Armed Forces yet? When the
magazine is empty, or for some reason, the round hasn't been
chambered, the bolt(?) will stay back. You have to press a button
to release the bolt into the forward position. We call it 'ease
spring'.
So in this case, the soldiers you have seen were probably checking
that their weapons were safe; that no rounds have been
chambered.
Or if you've the soldiers doing that in the movies, then it is
probably just lazy film making. Either that or the budget was so
low that they couldn't even afford dummy rounds.