I'll agree that it seems to be amenities-based to a pretty hefty extent. Building storefronts that the settlers like and making sure everyone has a job increases it. Putting in powered lights to the buildings helps. Decorations helps as well. I just finished building a nursery to see if that increases the happiness - will report back with the results after I play tonight. My happiness for the settlement that I actually care about stays in the mid-80s.
I've also noticed some weird things that I can't really explain. Sanctuary started out as my main base and I spent a lot of time building it out, but the settler happiness never went above 78%. When I decided to move my home base to another location and broke everything down, I sent the settlers that had come in to the other place and just left the original named npcs there. I built out enough to sustain them with a little extra, and their happiness shot up to 86%. So apparently the four of them + the mr handy are quite happy without any other settlers there.
I'm also testing to see if there's anything to the composition of the settlers themselves. I have one settlement that is all female and one that is all male. I'm curious if Bethesda programmed in happiness points for when the sixes are mixed versus not, and whether an even mix (one man for one woman) makes any difference. Might be completely ridiculous to test, but they sure are banging us over the head with an agenda so I wouldn't be surprised. If it turns out to be the case, I also wonder if it's programmed in that certain npcs like certain jobs better than others - like the guys prefer security and farming, and the girls prefer running storefronts and hospitals. I REALLY hope that doesn't turn out to be the case, but who knows.
I've also noticed some buggyness with farming. I put down a whole lot of mutfruit trees figuring hey, they are worth 1 food so why not? At a certain point they stopped registering as being there. Physically I could see them, but they were not selectable. I had to remove all the selectable ones, fast travel out and then back in before I could remove those as well. I guess I hit a memory limitation or something. Now I'm not putting down more food than necessary even though I want half the zone to be an orchard.
Cool feature in the game and I like it a lot, but it could really use some tweaks, like the settlers actually suggesting things that would make them happier.