bag.itunes.apple.com is just an Apple sub-server that generally handles the purchase cart when shopping in the iTunes stores.
It can't be contacted by other services for something, like pending purchases or other billing issues. It's not abnormal to have it bee accessed when using Apple Music or the iTunes Store, and yes it will use your Apple credentials for that. Again, perfectly normal and expected.
What is abnormal is for its certificate to be invalid. If doing this on a Windows PC, I would assume a hijacker was installed and is redirecting the calls to their own server, but being on an iPad its almost impossible, so may just be a glitch.
Unless it continues to happen, I would not worry too much about it.
This thread has been closed by the system or the community team.
You may vote for any posts you find helpful, or search the Community for additional answers.
Apple Music shows a certificate error from bag.itunes.com
Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.