People falling or suicide, not sure which was more common reason. On the ground level/2nd floor I always thought it was to prevent burglaries (doors are much heavier than in the US, strong bolts, strong locks, etc.), but it wasn't until this last trip that I spent any time on a third floor or higher.
The fifth floor apartment I stayed at had thick cable wires across the balcony to prevent people falling, despite they'd have to climb over a four foot (edit: 3.5 foot) ledge to do so.
Then we visit the other apartment, and I can't recall what floor it was (3rd-6th floor somewhere in there) and there was no bars. I'm tired and dozing off sitting at the table until through my half-closed eyes I see my 4 year old trying to sit up onto the ledge. That woke me up! Apparently the bars cost more money so at the time they got the apartment they didn't see the need for it (they didn't have any small children of their own).