A danger area is established to protect and warn other air traffic of high risk activities in an area. For example UAS operations in BVLOS, military activity, rock blasting at a construction site etc.
Flying in danger areas is not prohibited, however, it should be avoided unless the operator can guarantee it can be performed without increased risk due to the ongoing activity.
Dangers areas are notified via AIP SUP and NOTAM, they are also usually published on the Dronechart.