Birds use a lot of ways to protect their nest and so make it a safe place for its eggs and young.
Nesting materials such as lichen camouflage the nest, helps keep water out and also make the nest stronger. A nest made of twigs, leaves and mosses which is built among twigs leaves and mosses is very hard to see as it blends in with its surroundings.
Wrens are known to build a lot of nests each year. Most of these nests are empty but will attract any predator – only to find it is an empty nest with nothing in for the predator to eat.
Nesting birds try to lure a predator away from a nest – sometimes pretending to be injured and so attract the predator away from their young. I have seen this happen with a ground nesting bird.
Some nests are hidden away in some sort of cavity. This means there is only a small opening to the world.
If a nest is built in a thorny hedge or a tree cavity it will be hard to attack. Some birds build nests with a domed top
Birds often protect their nests from sun, wind and rain by having the nest opening away from the bad weather or take advantage of any shelter in the area.
Plants can keep pests, bacteria and parasites away from nests. Pests, bacteria and parasites can make young birds in the nest ill. Aromatic plants are used by birds and added to the nest.
So when a bird builds a nest it is not a random thing. A lot of knowledge, thought and heredatory knowledge goes into each bird nest.