Jenkins uses string interpolation to take password as input and it uses AES to encrypt and protect secrets, credentials, and their respective encryption keys.
So, using direct or simple approach will ...
I wrote about Jenkins Docker in Docker Agent which you may find useful.
The article answers your questions in detail.
I'll answer them shortly here as well:
Why having it running as two containers?