As long as you're restoring from a backup as part of the setup of a new iOS device, or doing some form of data migration on Mac (Setup Assistant or Migration Assistant, by either a hardwired or wifi connection, or from a Time Machine backup), then the email account settings move across, too. If you didn't do that... the process of adding settings for major services like Gmail and Yahoo is little more than selecting the service and entering your email address and password - a pretty easy thing to forget you did, in the big scheme.
I can appreciate wanting to be able to have a one-stop shop for your email at iCloud.com, but likely way too much to hope for. Definitely a first world problem.