You don't mention if you were entering the US with a visa or under the Visa Waiver Program, and the details will be slightly different depending on that, but in general it's very similar.
You were re-admitted to the US under your previous entry record.
If you were in the US under the Visa Waiver Program, then short trips to Canada (or Mexico or a few other nearby locations) do not end/restart your entry into the US. This is done mainly to avoid people doing "visa runs" to those countries.
If you knew you were re-entering the US, you should have kept your I94 form and you would have been able to show it on re-entry to the US - although obviously the immigration officials had an electronic record of it so were able to find the details anyway.
If you were in the US on a visa, then the process is a little different but fundamentally the same. You would have been re-admitted into the US using a process called 'Automatic Revalidation', which results in basically the same thing as described above.
The benefit of Automatic Revalidation is that it allows you to re-enter the US from Canada/Mexico even if your US visa has expired - as long as your previous stay (ie, I94) is still valid.
Both of these processes only occur for trips to Canada, Mexico, and a few nearly islands. If you went any further than those then you would have been re-admitted to the US as a new stay, with a new I94 record being generated.