Happiness Mechanic

It would be really helpful for a explanation of the how happiness works. E.g. How it is gained; how it is lost; what effect it has and other bits of information about it.
I know that if happiness is >=0 then you get a 5% buff on dev points and community buildings increase it. But why does it start a 300 then decrease so rapidly.

TLDR- The happiness mechanic isnt explained and seems to be useless