the password is saved in your keychain. you probably accidentally checked the Remember Password checkbox the last time you put in your password.
you can go into keychain access and remove it if you want to.
also fun fact: if you have several password-protected disk images, you can create a separate keychain and move the DMG passwords to that keychain. Then you unlock ONE keychain (with password) and that can immediately allow all other disk images to open without a password since the keychain the passwords are on is now available. Wwhen you try to open a disk image that has a password on the new keychain which is locked, it will prompt you for the password to the keychain, unlock it, and use the dmg password immediately without having to provide the password for the DMG. Keychains remain unlocked in this way for 15 minutes after their last use, so you can select several disk images and open them all at once, only having to provide a password once to unlock the keychain.