Ah, 'the moon is beautiful, isn't it?' is a famous Japanese phrase originated from the Meiji era writer Natsume Soseki. As he was an English literature professor, he thought direct translations of 'I love you' were too straightforward for Japanese culture. So, he proposed using this moon metaphor instead.
Essentially, remarking the beauty of the moon is a roundabout expression of love, a poetic way for someone to confess their feelings, just like the moon subtly influencing the tides, this sentence subtly conveys one's emotions. It's not the moon that's beautiful, it's the company, the moment, the underlying emotions.