Plus, I googled it, according to the Free Dictionary of idioms:
“What’s the magic word?” (British and Australian)
‘something that you say to a child in order to make them say ‘please’ or ‘thank you’
So they had it partially right! I have started giving thanks for the difficult things to get better, for good things, as they are now, but then giving thanks because they are about to be GREAT!