This a hive, not a beehive, but a hive for wasps. In Spain wasps are called avispas. The wasps in the picture look different from those that visit the pool. The ‘pool wasps’ are bigger and have tails.
Bees and wasps have important functions in nature. They eat other less useful animals and inseminate flowers so plants can bear fruits. They can seriously hurt you when they sting. Some people are allergic and live constantly in fear of bees and wasps.
The interesting question is how you keep them out of the garden. In fact it’s very simple. If you don’t have plants, bushes or trees that grow flowers, you will never see them. This is probably one of the reasons many a Spanish house over here has an asphalted garden and you can recognize a British garden when it has a lot of flowery plants. Preferably the whole year through.
And there are moscas, or flies. They are also a sustained nuisance. They are usefull because they are eaten by other animals. But over here there are not enough moscas-eating animals.
To get rid of moscas is far more difficult. Where there are bigger animals, such as pets, that shit and pee indiscriminately, there are moscas. And not just a few, but a lot. So since our neighbor has five dogs and feasts twenty cats, we have a lot of flies.
Another source of flies are the pigsties over here. When the wind is right you can smell them. When you can smell them, the flies of the pigsties outnumber the ones from the neighbor. Goats, mules, horses and cows can also be found here and are favorite breeding grounds for flies.
Evolutionary speaking most insects are millions and millions of years older then we are and will probably outlive us.