it's not to keep people in, often to keep anyone out (yes even top floors) although theft is not such a huge problem, they are common all throughout China even on private homes, nothing to do with slave labour work environments or anything similar, very often used for hanging the washing from
a larger benefit to bars on windows is to stop people throwing rubbish out, it's not unheard of to have people injured or killed from stuff thrown out of windows, lots of buildings have warnings on them to remind residents not to throw rubbish out the window, still some out there that don't follow the warnings though