In other Latin languages like Spanish and Portuguese one form of the "to be" verb is used for temporary situations (like someone's mood, health, etc) and the other is used for permanent situations (buildings, gender, etc). In this case it seems that sono is the permanent form and stanno is the temporary form.
It's confusing, I know. In this case a relationship may be long lasting, but how well they go together is temporary and may change depending on a lot of outside factors (age, mood, financial situation, attitude, religion, political affiliation, etc).
Beauty is a good example. I always tell my wife she is (essere) beautiful, referring to her natural beauty and who she is as a person. Then when she dresses up I tell her she is (stare) beautiful, which is referring to how she looks.
No, actually the rules about “ser” and “estar” are more complicated than that. When you’re talking about people, yes, use “ser” for permanent qualities and “estar” for fleeting emotions. But estar is also used for locations, for example buildings (“desculpe, dónde está la farmacia?”) whereas the location of events uses ser, and events certainly aren’t permanent. “Stare” in Italian is always used to conjugate the present progressive, and also in some idiomatic expressions.
I think this is the expression they are good together. They work well, make a good team, are a good fit. To me this is easier to come to than they work well together because stanno means they are, and in English (at least in my corner of the world) good and well are close enough that translating bene as good in this instance is, well, fine. O...insomma, bene.