TTL stands for 'Through The Lens'...meaning that the camera meters the flash with the reflected light that comes back into the lens.
In a nutshell, the flash (or a dedicated flash unit) will fire a quick pre-flash right before the photo is taken. The camera measures the light that is reflected from the pre-flash to decide how much flash power to use for the actual exposure...it also takes into account the aperture that the lens is set to, and the ISO. That is 'E-TTL'.
Just like the camera's ambient metering, the flash metering is set to give you a mid range exposure level...and you can change that by adjusting the FEC (flash exposure compensation).
There is a lot more to know about how E-TTL actually works and it is still unpredictable some times. It really depends a lot on the reflectivity of your subject. If you shoot something that is highly reflective, it will likely cause an underexposure, so you need to be aware of stuff like that.
There are other ways to meter for flash. A hand held flash meter, for example...or you could calculate the aperture to use, based on the Guide Number (GN) of the flash and the distance to the subject. Or, you could use the guess & test method.
THIS ARTICLE, will tell you everything you wanted to know about Canon flash photography....and a whole lot more.