Whether it is a planned bivouac or the trip is taking longer than expected: a place to sleep is often only sought once dusk has fallen. Then there is no light, time or calm left to spot hazards, and people take the first reasonably flat patch.
It cools down at night, often more than expected – especially in hollows and valleys where cold air drains down, and on clear, still nights. The ground constantly draws heat from a lying body; without insulation underneath you will be cold even under a good cover.
The typical hazards come from above, below and the side: dead branches and rotten trees that break in wind; gullies and dry stream beds that can fill with water quickly in rain; rockfall below cliffs; avalanche slopes in winter. On top of that comes carbon monoxide if a stove is run inside a tent or under a tarp.
What matters: start early, check the spot thoroughly while it is light, set up insulation from the ground and protection from wind and wet, keep dry clothes ready for the night – and respect local rules on overnight stays and fires.