They break up the ice-sheets when snow / ice freezes on your roof. You can literally die if a sheet of ice falls on you during the winter, its a rather traumatic event. These guards help prevent this disaster, especially in areas where people tend to be walking around (aka: around homes).
They are ice and snow catcher things. They come in different forms, sometimes bars and these new versions in your picture. They hold the snow and ice in place during the winter.
Ice and snow will build up and weigh a ton, sometimes literally, and that weight falling on someone could easily kill them. With this system you are far less likely to have the entire sheet come down and it lets the cold stuff melt on the roof instead on people's heads.
They keep built up snow and ice from sliding off of the roof and injuring people. You’ll usually see them on roofing near or overhanging walkways and sidewalks.